diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-11-04 07:45:34 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-11-04 07:45:34 +0000 |
commit | f674c488d9701e577e2aaf25e331fb44ada4f1ef (patch) | |
tree | a17b518541886e5e1cbbee26c47a470378533348 /modules | |
parent | 321e13ca176b256177c4a752d1f2bbee79b5532e (diff) | |
download | stable-diffusion-webui-gfx803-f674c488d9701e577e2aaf25e331fb44ada4f1ef.tar.gz stable-diffusion-webui-gfx803-f674c488d9701e577e2aaf25e331fb44ada4f1ef.tar.bz2 stable-diffusion-webui-gfx803-f674c488d9701e577e2aaf25e331fb44ada4f1ef.zip |
bugfix: save image for hires fix BEFORE upscaling latent space
Diffstat (limited to 'modules')
-rw-r--r-- | modules/processing.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/processing.py b/modules/processing.py index a46e592d..7a2fc218 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -665,17 +665,17 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): images.save_image(image, self.outpath_samples, "", seeds[index], prompts[index], opts.samples_format, suffix="-before-highres-fix")
if opts.use_scale_latent_for_hires_fix:
+ for i in range(samples.shape[0]):
+ save_intermediate(samples, i)
+
samples = torch.nn.functional.interpolate(samples, size=(self.height // opt_f, self.width // opt_f), mode="bilinear")
-
+
# Avoid making the inpainting conditioning unless necessary as
# this does need some extra compute to decode / encode the image again.
if getattr(self, "inpainting_mask_weight", shared.opts.inpainting_mask_weight) < 1.0:
image_conditioning = self.img2img_image_conditioning(decode_first_stage(self.sd_model, samples), samples)
else:
image_conditioning = self.txt2img_image_conditioning(samples)
-
- for i in range(samples.shape[0]):
- save_intermediate(samples, i)
else:
decoded_samples = decode_first_stage(self.sd_model, samples)
lowres_samples = torch.clamp((decoded_samples + 1.0) / 2.0, min=0.0, max=1.0)
|