Skip to content

Commit 2996e43

Browse files
committed
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
1 parent 4d5db58 commit 2996e43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/txt2img.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ def txt2img_upscale(id_task: str, request: gr.Request, gallery, gallery_index, g
6060
assert len(gallery) > 0, 'No image to upscale'
6161
assert 0 <= gallery_index < len(gallery), f'Bad image index: {gallery_index}'
6262

63-
p = txt2img_create_processing(id_task, request, *args)
64-
p.enable_hr = True
63+
p = txt2img_create_processing(id_task, request, *args, force_enable_hr=True)
6564
p.batch_size = 1
6665
p.n_iter = 1
66+
# txt2img_upscale attribute that signifies this is called by txt2img_upscale
6767
p.txt2img_upscale = True
6868

6969
geninfo = json.loads(generation_info)

0 commit comments

Comments
 (0)