From 8b90bd88b55f5293ae82b833ec29b4cb785e29de Mon Sep 17 00:00:00 2001 From: layerdiffusion <19834515+lllyasviel@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:35:25 -0700 Subject: [PATCH] fix #1367 --- modules/txt2img.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/txt2img.py b/modules/txt2img.py index 94c1e8de..6e79ebd5 100644 --- a/modules/txt2img.py +++ b/modules/txt2img.py @@ -61,7 +61,7 @@ def txt2img_upscale_function(id_task: str, request: gr.Request, gallery, gallery assert 0 <= gallery_index < len(gallery), f'Bad image index: {gallery_index}' # catch situation where user tries to hires-fix the grid: probably a mistake, results can be bad aspect ratio - just don't do it - if opts.return_grid == True and 0 == gallery_index: + if opts.return_grid and 0 == gallery_index and len(gallery) > 1: return gallery, generation_info, 'Unable to upscale the grid image.', '' p = txt2img_create_processing(id_task, request, *args, force_enable_hr=True)