aboutsummaryrefslogtreecommitdiff
path: root/modules/extras.py
diff options
context:
space:
mode:
authorBilly Cao <aliencaocao@gmail.com>2022-11-06 16:33:08 +0800
committerGitHub <noreply@github.com>2022-11-06 16:33:08 +0800
commitc13e234444e98d112e9fe99d518c834edeb79471 (patch)
tree8dfa10582dccb75685b4dd3ee28d1d48c0a6f595 /modules/extras.py
parent55ca04095845b41bf66333b3b7343e3ea0babed1 (diff)
parent5302e2cdd4c8f039a68e900d739285d15d99d200 (diff)
Merge branch 'master' into enable-override-hypernet
Diffstat (limited to 'modules/extras.py')
-rw-r--r--modules/extras.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/extras.py b/modules/extras.py
index 8e2ab35c..71b93a06 100644
--- a/modules/extras.py
+++ b/modules/extras.py
@@ -136,12 +136,13 @@ def run_extras(extras_mode, resize_mode, image, image_folder, input_dir, output_
def run_upscalers_blend(params: List[UpscaleParams], image: Image.Image, info: str) -> Tuple[Image.Image, str]:
blended_result: Image.Image = None
+ image_hash: str = hash(np.array(image.getdata()).tobytes())
for upscaler in params:
upscale_args = (upscaler.upscaler_idx, upscaling_resize, resize_mode,
upscaling_resize_w, upscaling_resize_h, upscaling_crop)
- cache_key = LruCache.Key(image_hash=hash(np.array(image.getdata()).tobytes()),
+ cache_key = LruCache.Key(image_hash=image_hash,
info_hash=hash(info),
- args_hash=hash((upscale_args, upscale_first)))
+ args_hash=hash(upscale_args))
cached_entry = cached_images.get(cache_key)
if cached_entry is None:
res = upscale(image, *upscale_args)