From 3b4eedd90fe8ebcac5363f586157d36dcd9a513f Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 11 May 2024 21:05:51 +0800 Subject: [PATCH] Fix upscale script checking (#2881) --- scripts/controlnet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/controlnet.py b/scripts/controlnet.py index 35b349ff2..f79cf0f6c 100644 --- a/scripts/controlnet.py +++ b/scripts/controlnet.py @@ -755,7 +755,7 @@ def try_crop_image_with_a1111_mask( # based on `extra_generation_params` these scripts attach on `p`, and subject to change # in the future. # TODO: Change this to a more robust condition once A1111 offers a way to verify script name. - is_upscale_script = any("upscale" in k.lower() for k in getattr(p, "extra_generation_params", {}).keys()) + is_upscale_script = any("upscale" in k.lower() and "Hires" not in k for k in getattr(p, "extra_generation_params", {}).keys()) logger.debug(f"is_upscale_script={is_upscale_script}") # Note: `inpaint_full_res` is "inpaint area" on UI. The flag is `True` when "Only masked" # option is selected.