M08: Thread opts_snapshot into process_images_inner for save-related reads

- Replace opts.foo with p.opts_snapshot.foo for safe read-only settings
- Migrated: save_images_before_face_restoration, save_images_before_color_correction,
  samples_format, return_mask, save_mask, return_mask_composite, save_mask_composite,
  grid_only_if_multiple, return_grid, grid_save, grid_format, grid_extended_filename
- Leave save_samples(), sample_hr_pass(), create_infotext(), metadata on shared.opts
- Behavior-preserving; no change to save paths or naming

Made-with: Cursor
This commit is contained in:
Michael Cahill 2026-03-11 19:43:06 -07:00
parent c943849d1d
commit be214f4eda
3 changed files with 1805 additions and 1780 deletions

View file

@ -1,3 +1,24 @@
# M08 Plan — Snapshot Threading into process_images_inner
(To be populated.)
## Intent
M07 introduced `p.opts_snapshot`. M08 threads it into the generation runtime by migrating safe read-only option access inside `process_images_inner()` from `shared.opts` to `p.opts_snapshot`.
## Scope
- **In scope:** Replace `opts.foo` with `p.opts_snapshot.foo` for save-related reads inside `process_images_inner()` only.
- **Out of scope:** save_samples(), sample_hr_pass(), create_infotext(), Processed.__init__(), fill_fields_from_opts(), modules/images.py.
## Migrated Options
- save_images_before_face_restoration
- save_images_before_color_correction
- samples_format
- return_mask, save_mask
- return_mask_composite, save_mask_composite
- grid_only_if_multiple, return_grid, grid_save
- grid_format, grid_extended_filename
## Invariants
Same inputs → same outputs. File paths and naming unchanged. Extension compatibility preserved.

View file

@ -2,4 +2,8 @@
Implementation toolcalls for Cursor execution.
(To be filled during milestone execution.)
| Timestamp | Tool | Purpose | Files | Status |
|-----------|------|---------|-------|--------|
| 2026-03-11 | git checkout | Create/use m08-snapshot-threading branch | — | Done |
| 2026-03-11 | search_replace | Migrate save-related opts to p.opts_snapshot in process_images_inner | modules/processing.py | Done |
| 2026-03-11 | ruff check | Lint processing.py (pre-existing F811 in file) | modules/processing.py | Done |

File diff suppressed because it is too large Load diff