diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-23 14:37:47 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-23 14:37:47 +0000 |
commit | 1a0353675de8b2f4d2ce784a37fe4d6121307131 (patch) | |
tree | 3ba85369a41c93ecb55c27accfa2163f38f06339 /modules/processing.py | |
parent | 6fa20d51dcfd7db3286bc9dad31455b69b6daf65 (diff) | |
download | stable-diffusion-webui-gfx803-1a0353675de8b2f4d2ce784a37fe4d6121307131.tar.gz stable-diffusion-webui-gfx803-1a0353675de8b2f4d2ce784a37fe4d6121307131.tar.bz2 stable-diffusion-webui-gfx803-1a0353675de8b2f4d2ce784a37fe4d6121307131.zip |
Option to use advanced upscalers with normal img2img
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 4 |
1 files changed, 2 insertions, 2 deletions
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)
|