From 2bded1cf6c4fd11725b5cc3b6d5d29e425c3cdf3 Mon Sep 17 00:00:00 2001 From: JasonHoku Date: Mon, 9 Mar 2026 03:29:11 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20upscaling=20manifest=20issues=20?= =?UTF-8?q?=E2=80=94=20correct=20file=20URL,=20add=20id=20field,=20skip=20?= =?UTF-8?q?base=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three bugs fixed: 1. Upscaled images used bare 'filename=...' instead of full '/view?filename=...&type=output&subfolder=...' URL format, causing 404s in dashboard 2. Upscaled manifest entries missing 'id' and 'rejected' fields, causing holes in dashboard grid 3. Base (non-upscaled) images were still saved to pending_batch when upscaling was enabled — now only upscaled final versions appear in output Co-Authored-By: Claude Opus 4.6 --- generation_orchestrator.py | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/generation_orchestrator.py b/generation_orchestrator.py index 75787d4..a94e334 100644 --- a/generation_orchestrator.py +++ b/generation_orchestrator.py @@ -1094,9 +1094,11 @@ def run_generation_loop( ) # ==== UPSCALING (array-based with Cartesian expansion) ==== + upscale_produced = False if session_settings and session_settings.get("upscaling", {}).get("enabled", False) and result_latent is not None: from .image_generation import upscale_image import itertools as upscale_itertools + import random as upscale_random from PIL import Image as PILImage upscale_configs = session_settings["upscaling"].get("configs", []) @@ -1178,14 +1180,18 @@ def run_generation_loop( actual_positive_prompt, actual_negative_prompt, gen_index=gen_index_offset + total_generated ) + # Generate unique ID for dashboard display (same pattern as flush_batch_with_vae) + upscaled_meta["id"] = int(time.time() * 100000) + upscale_random.randint(0, 1000) upscaled_meta["upscaled"] = True upscaled_meta["upscale_mode"] = mode upscaled_meta["upscale_ratio"] = up_ratio upscaled_meta["upscale_denoise"] = up_denoise if up_model_name: upscaled_meta["upscale_model"] = up_model_name - upscaled_meta["file"] = f"filename={upscaled_filename}" + upscaled_meta["file"] = f"/view?filename={upscaled_filename}&type=output&subfolder=benchmarks/{session_name}/images" + upscaled_meta["rejected"] = False existing_data["items"].append(upscaled_meta) + upscale_produced = True print(f"[GridTester] 🔍 Saved upscaled image: {upscaled_filename} " f"(mode={mode}, ratio={up_ratio}, denoise={up_denoise}" @@ -1225,16 +1231,19 @@ def run_generation_loop( except Exception: pass - meta = create_image_metadata( - conf, w, h, duration, current_seed, batch_idx, - actual_positive_prompt, actual_negative_prompt, - gen_index=gen_index_offset + total_generated - ) - if pos_hash or neg_hash: - meta["conditioning_pos_hash"] = pos_hash - meta["conditioning_neg_hash"] = neg_hash - - pending_batch.append((result_latent["samples"].clone(), meta)) + # Skip saving the base (non-upscaled) image when upscaling produced results + # — only the upscaled final version(s) should appear in the output + if not upscale_produced: + meta = create_image_metadata( + conf, w, h, duration, current_seed, batch_idx, + actual_positive_prompt, actual_negative_prompt, + gen_index=gen_index_offset + total_generated + ) + if pos_hash or neg_hash: + meta["conditioning_pos_hash"] = pos_hash + meta["conditioning_neg_hash"] = neg_hash + + pending_batch.append((result_latent["samples"].clone(), meta)) total_generated += 1 # ==== GPU COOLDOWN (if enabled in session settings) ====