Commit 490c519 added a webp/png/jpg dropdown but only flush_batch_with_vae
honored it. Three other save sites still hardcoded WEBP:
- flush_batch_with_remote_vae (image_generation.py)
- upscale_runner.py (3 sites in inline + deferred upscale paths)
- distribution_worker.py (PIL bytes shipped back to master)
Now all save sites read image_format from session_settings (orchestrator)
or the job spec (distributed) and match the format/extension.
Changes:
- remote_vae.py: RemoteVAEDecodeWorker accepts image_format kwarg; _worker
uses it to pick format/extension at save time (the real save site for the
remote VAE path — flush_batch_with_remote_vae only queues to the worker)
- generation_orchestrator.py: passes image_format to all RemoteVAEDecodeWorker
constructors (initialize_remote_vae + 3 per-config sites); adds image_format
to all 8 existing_data["meta"] writes so upscale_runner can read it from disk
- upscale_runner.py: reads image_format from manifest meta at thread start;
uses _fmt/_ext locals at all 3 save sites (seedvr2, latent-decode, PIL)
- distribution_manager.py: injects _session_image_format into worker job
config alongside existing _session_cooldown passthrough
- distribution_worker.py: reads _session_image_format from config; encodes
bytes in the chosen format; stamps _image_ext on meta so master uses it
- distribution_routes.py: pops _image_ext from meta to build filename with
correct extension before writing bytes to disk
Default behavior unchanged: all paths fall back to webp if image_format
is absent or unrecognised.
Code review found this in 490c519.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dashboard fast-path sort assumes newest items are at the start of the
items array. append() put upscaled images at the end (oldest position),
making them appear as the oldest items when sorting by newest.
Changed both SeedVR2 and regular upscale paths from append() to
insert(0, ...) so upscaled images appear at the top (newest position).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
UnboundLocalError when SeedVR2 upscale completed — total_upscale_duration
was referenced but never initialized. Added initialization to 0 at the
start of each per-image loop.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The dashboard upscale (⬆ button) goes through upscale_runner.py, not
generation_orchestrator.py. SeedVR2 mode was only wired into the
inline orchestrator path — dashboard upscales silently produced no
output because mode="seedvr2" resulted in empty combos list.
Now upscale_runner.py handles mode=="seedvr2":
- Opens source image from disk as PIL (no latent decode needed)
- Calls seedvr2_upscale() from image_generation.py
- Saves result as _upscaled.webp in images directory
- Creates manifest entry with proper gen_index, file URL, metadata
- Supports chained steps (SeedVR2 → next step gets PIL result)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add "file" URL to manifest entries (dashboard needs /view?filename=...
URL, not just the filename field)
- Exclude "file" and "gen_index" from source item copy to prevent
stale values leaking through
- Assign gen_index = len(manifest_data["items"]) so upscaled images
sort as newest instead of near their source image
- Send all new items per image via update_data event, not just the last
- Set PromptServer.last_prompt_id before sampling (KSampler progress
callbacks require it, fixes AttributeError)
- Clear VRAM and RAM (soft_empty_cache, gc.collect, cuda.empty_cache)
on completion, cancellation, and error via finally block
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Manifest items use 'file' with a /view?filename=... URL, not a
'filename' field. Now parses the URL to extract the actual filename
when 'filename' is not directly available.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- load_checkpoint() needs target_model_name, ckpt_name, use_remote_vae
positional args — was being called with just model_name
- Preset save endpoints now validate for empty request body before
JSON parsing to avoid "Expecting value" errors
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Background thread loads models, runs full pipeline chains, saves
upscaled images, updates manifests, and sends progress events.
Supports single image and all-favorited modes with cancel support.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>