From 2996e43ff71ca50f6e5b64676f998946d8041d19 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Sat, 27 Jan 2024 14:49:50 +0900 Subject: [PATCH] fix txt2img_upscale use force_enable_hr to set p.enable_hr = True allow Script.setup() have access to the correct value add a comment for p.txt2img_upscale --- modules/txt2img.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/txt2img.py b/modules/txt2img.py index 4efcb4c3d..fc56b8a86 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -60,10 +60,10 @@ def txt2img_upscale(id_task: str, request: gr.Request, gallery, gallery_index, g assert len(gallery) > 0, 'No image to upscale' assert 0 <= gallery_index < len(gallery), f'Bad image index: {gallery_index}' - p = txt2img_create_processing(id_task, request, *args) - p.enable_hr = True + p = txt2img_create_processing(id_task, request, *args, force_enable_hr=True) p.batch_size = 1 p.n_iter = 1 + # txt2img_upscale attribute that signifies this is called by txt2img_upscale p.txt2img_upscale = True geninfo = json.loads(generation_info)