aboutsummaryrefslogtreecommitdiffstats
path: root/modules/images.py
diff options
context:
space:
mode:
authorspace-nuko <24979496+space-nuko@users.noreply.github.com>2023-03-28 14:59:12 +0000
committerGitHub <noreply@github.com>2023-03-28 14:59:12 +0000
commit4414d36bf6e4f64cb6eac871c89c2e0daa4c5338 (patch)
treef35f4205328d275427781cdef145ae12014a6ad4 /modules/images.py
parentc5f9f7c23759f9a74fa2b563451569c8926604ba (diff)
parent955df7751eef11bb7697e2d77f6b8a6226b21e13 (diff)
downloadstable-diffusion-webui-gfx803-4414d36bf6e4f64cb6eac871c89c2e0daa4c5338.tar.gz
stable-diffusion-webui-gfx803-4414d36bf6e4f64cb6eac871c89c2e0daa4c5338.tar.bz2
stable-diffusion-webui-gfx803-4414d36bf6e4f64cb6eac871c89c2e0daa4c5338.zip
Merge branch 'master' into img2img-enhance
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/images.py b/modules/images.py
index 7030aaaa..b3535070 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -261,9 +261,12 @@ def resize_image(resize_mode, im, width, height, upscaler_name=None):
if scale > 1.0:
upscalers = [x for x in shared.sd_upscalers if x.name == upscaler_name]
- assert len(upscalers) > 0, f"could not find upscaler named {upscaler_name}"
+ if len(upscalers) == 0:
+ upscaler = shared.sd_upscalers[0]
+ print(f"could not find upscaler named {upscaler_name or '<empty string>'}, using {upscaler.name} as a fallback")
+ else:
+ upscaler = upscalers[0]
- upscaler = upscalers[0]
im = upscaler.scaler.upscale(im, scale, upscaler.data_path)
if im.width != w or im.height != h: