diff options
author | evshiron <evshiron@gmail.com> | 2022-11-04 17:43:02 +0000 |
---|---|---|
committer | evshiron <evshiron@gmail.com> | 2022-11-04 17:43:02 +0000 |
commit | 73e1cd6f53f3566973805666a4049450cdb8da1b (patch) | |
tree | 90c4f0e6b8853c564894409c596e4bd57bca578a /modules/extras.py | |
parent | e21fcd72fcf147904a1df060226c4df12acf251e (diff) | |
parent | 89722fb5e4eda2adc5d3a6abf8babf8a58e80d69 (diff) | |
download | stable-diffusion-webui-gfx803-73e1cd6f53f3566973805666a4049450cdb8da1b.tar.gz stable-diffusion-webui-gfx803-73e1cd6f53f3566973805666a4049450cdb8da1b.tar.bz2 stable-diffusion-webui-gfx803-73e1cd6f53f3566973805666a4049450cdb8da1b.zip |
Merge branch 'master' into fix/encode-pnginfo
Diffstat (limited to 'modules/extras.py')
-rw-r--r-- | modules/extras.py | 5 |
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)
|