Skip to content

Commit 2bded1c

Browse files
JasonHokuclaude
andcommitted
fix: upscaling manifest issues — correct file URL, add id field, skip base image
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 <noreply@anthropic.com>
1 parent 5e1c1a4 commit 2bded1c

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

generation_orchestrator.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,9 +1094,11 @@ def _preload_diff_worker(conf_to_load=next_conf):
10941094
)
10951095

10961096
# ==== UPSCALING (array-based with Cartesian expansion) ====
1097+
upscale_produced = False
10971098
if session_settings and session_settings.get("upscaling", {}).get("enabled", False) and result_latent is not None:
10981099
from .image_generation import upscale_image
10991100
import itertools as upscale_itertools
1101+
import random as upscale_random
11001102
from PIL import Image as PILImage
11011103

11021104
upscale_configs = session_settings["upscaling"].get("configs", [])
@@ -1178,14 +1180,18 @@ def _preload_diff_worker(conf_to_load=next_conf):
11781180
actual_positive_prompt, actual_negative_prompt,
11791181
gen_index=gen_index_offset + total_generated
11801182
)
1183+
# Generate unique ID for dashboard display (same pattern as flush_batch_with_vae)
1184+
upscaled_meta["id"] = int(time.time() * 100000) + upscale_random.randint(0, 1000)
11811185
upscaled_meta["upscaled"] = True
11821186
upscaled_meta["upscale_mode"] = mode
11831187
upscaled_meta["upscale_ratio"] = up_ratio
11841188
upscaled_meta["upscale_denoise"] = up_denoise
11851189
if up_model_name:
11861190
upscaled_meta["upscale_model"] = up_model_name
1187-
upscaled_meta["file"] = f"filename={upscaled_filename}"
1191+
upscaled_meta["file"] = f"/view?filename={upscaled_filename}&type=output&subfolder=benchmarks/{session_name}/images"
1192+
upscaled_meta["rejected"] = False
11881193
existing_data["items"].append(upscaled_meta)
1194+
upscale_produced = True
11891195

11901196
print(f"[GridTester] 🔍 Saved upscaled image: {upscaled_filename} "
11911197
f"(mode={mode}, ratio={up_ratio}, denoise={up_denoise}"
@@ -1225,16 +1231,19 @@ def _preload_diff_worker(conf_to_load=next_conf):
12251231
except Exception:
12261232
pass
12271233

1228-
meta = create_image_metadata(
1229-
conf, w, h, duration, current_seed, batch_idx,
1230-
actual_positive_prompt, actual_negative_prompt,
1231-
gen_index=gen_index_offset + total_generated
1232-
)
1233-
if pos_hash or neg_hash:
1234-
meta["conditioning_pos_hash"] = pos_hash
1235-
meta["conditioning_neg_hash"] = neg_hash
1236-
1237-
pending_batch.append((result_latent["samples"].clone(), meta))
1234+
# Skip saving the base (non-upscaled) image when upscaling produced results
1235+
# — only the upscaled final version(s) should appear in the output
1236+
if not upscale_produced:
1237+
meta = create_image_metadata(
1238+
conf, w, h, duration, current_seed, batch_idx,
1239+
actual_positive_prompt, actual_negative_prompt,
1240+
gen_index=gen_index_offset + total_generated
1241+
)
1242+
if pos_hash or neg_hash:
1243+
meta["conditioning_pos_hash"] = pos_hash
1244+
meta["conditioning_neg_hash"] = neg_hash
1245+
1246+
pending_batch.append((result_latent["samples"].clone(), meta))
12381247
total_generated += 1
12391248

12401249
# ==== GPU COOLDOWN (if enabled in session settings) ====

0 commit comments

Comments
 (0)