aboutsummaryrefslogtreecommitdiff
path: root/modules/images.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-04-29 12:45:43 +0300
committerGitHub <noreply@github.com>2023-04-29 12:45:43 +0300
commite6cbfcfe5b42dd8d40ddaf2ecd448b8b0c070565 (patch)
tree6c31ea8ced8590afd4ba019be838bea41885b6cd /modules/images.py
parentc9647c8d23efa8c939c6af39878784e246082122 (diff)
parent2c935d8eb0be10edb226e145a72eb373451cb984 (diff)
Merge branch 'dev' into gradio-theme-support
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/images.py b/modules/images.py
index 7030aaaa..1a118a69 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:
@@ -349,6 +352,7 @@ class FilenameGenerator:
'prompt_no_styles': lambda self: self.prompt_no_style(),
'prompt_spaces': lambda self: sanitize_filename_part(self.prompt, replace_spaces=False),
'prompt_words': lambda self: self.prompt_words(),
+ 'clip_skip': lambda self: opts.data["CLIP_stop_at_last_layers"],
}
default_time_format = '%Y%m%d%H%M%S'