diff options
author | ParityError <36368048+ParityError@users.noreply.github.com> | 2023-03-29 01:29:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-29 01:29:59 +0000 |
commit | f69acfe9a4c09a5c2299e0cc2d5bdcd7a6e62285 (patch) | |
tree | 01852aeac922029273e08a90c683d63c6fc169cd /modules/images.py | |
parent | fb68d93b6a579a424919b22682cf067ce9a8e13f (diff) | |
parent | 3856ada5cc9ac4124e20ff311ce7aa77330845d9 (diff) | |
download | stable-diffusion-webui-gfx803-f69acfe9a4c09a5c2299e0cc2d5bdcd7a6e62285.tar.gz stable-diffusion-webui-gfx803-f69acfe9a4c09a5c2299e0cc2d5bdcd7a6e62285.tar.bz2 stable-diffusion-webui-gfx803-f69acfe9a4c09a5c2299e0cc2d5bdcd7a6e62285.zip |
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'modules/images.py')
-rw-r--r-- | modules/images.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/images.py b/modules/images.py index 2da988ee..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:
@@ -645,6 +648,8 @@ Steps: {json_info["steps"]}, Sampler: {sampler}, CFG scale: {json_info["scale"]} def image_data(data):
+ import gradio as gr
+
try:
image = Image.open(io.BytesIO(data))
textinfo, _ = read_info_from_image(image)
@@ -660,7 +665,7 @@ def image_data(data): except Exception:
pass
- return '', None
+ return gr.update(), None
def flatten(img, bgcolor):
|