From 694fff518d1d590a12aedb956ada22a0e62ee57b Mon Sep 17 00:00:00 2001 From: Haoming Date: Mon, 11 May 2026 16:00:57 +0800 Subject: [PATCH] upscale --- modules/txt2img.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/txt2img.py b/modules/txt2img.py index 834c1eb1..6aa12c25 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -116,7 +116,10 @@ def txt2img_upscale_function(id_task: str, request: gr.Request, gallery, gallery if insert or i != gallery_index: image[0].already_saved_as = image[0].filename.rsplit("?", 1)[0] new_gallery.append(image) - new_infotexts.append(geninfo["infotexts"][i]) + if i >= len(geninfo["infotexts"]): # e.g. ControlNet Detected Map + new_infotexts.append(None) + else: + new_infotexts.append(geninfo["infotexts"][i]) if i == gallery_index: new_gallery.extend(processed.images) new_infotexts.extend(processed.infotexts)