stable-diffusion-webui/modules/opts_snapshot.py
Michael Cahill 87c8fe8651 M07: Opts snapshot introduction
- Add modules/opts_snapshot.py with create_opts_snapshot(opts)
- Capture snapshot in process_images_inner after prepare_prompt_seed_state
- Full shallow copy of opts.data via SimpleNamespace
- No runtime behavior change; snapshot write-only for M07

Made-with: Cursor
2026-03-10 00:33:55 -07:00

15 lines
448 B
Python

"""Opts snapshot for generation runs.
M07: Deterministic snapshot of shared.opts for the duration of a run.
Behavior-preserving: shallow copy of opts.data.
Not yet threaded through runtime.
"""
from types import SimpleNamespace
def create_opts_snapshot(opts):
"""
Create an immutable snapshot of shared.opts for a generation run.
Behavior-preserving: shallow copy of opts.data.
"""
return SimpleNamespace(**opts.data.copy())