aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-04 11:04:01 +0300
committerGitHub <noreply@github.com>2022-11-04 11:04:01 +0300
commit1b9faaa1c304cd75080d1453a5cb26b02bbdb541 (patch)
treedd0e25e411bab25f2ca9cd2b29de049cfd6ea8b0 /modules
parentfaa79b08507eef48d66d4938420a3ae100bc467d (diff)
parent313e14de04d9955c6ad077341feceb0fc7f2f1d3 (diff)
Merge pull request #4196 from cobryan05/extras_no_rehash
extras - skip unnecessary second hash of image
Diffstat (limited to 'modules')
-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)