From 1a0353675de8b2f4d2ce784a37fe4d6121307131 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Fri, 23 Sep 2022 17:37:47 +0300 Subject: Option to use advanced upscalers with normal img2img --- modules/processing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/processing.py') diff --git a/modules/processing.py b/modules/processing.py index d27d86e9..79a159a2 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -462,7 +462,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): else: decoded_samples = self.sd_model.decode_first_stage(samples) - if opts.upscaler_for_hires_fix is None or opts.upscaler_for_hires_fix == "None": + if opts.upscaler_for_img2img is None or opts.upscaler_for_img2img == "None": decoded_samples = torch.nn.functional.interpolate(decoded_samples, size=(self.height, self.width), mode="bilinear") else: lowres_samples = torch.clamp((decoded_samples + 1.0) / 2.0, min=0.0, max=1.0) @@ -472,7 +472,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): x_sample = 255. * np.moveaxis(x_sample.cpu().numpy(), 0, 2) x_sample = x_sample.astype(np.uint8) image = Image.fromarray(x_sample) - upscaler = [x for x in shared.sd_upscalers if x.name == opts.upscaler_for_hires_fix][0] + upscaler = [x for x in shared.sd_upscalers if x.name == opts.upscaler_for_img2img][0] image = upscaler.upscale(image, self.width, self.height) image = np.array(image).astype(np.float32) / 255.0 image = np.moveaxis(image, 2, 0) -- cgit v1.2.3