diff options
author | random_thoughtss <random_thoughtss@proton.me> | 2022-10-29 17:02:56 +0000 |
---|---|---|
committer | random_thoughtss <random_thoughtss@proton.me> | 2022-10-29 17:02:56 +0000 |
commit | 44ab954fabb9c1273366ebdca47f8da394d61aab (patch) | |
tree | 2a25f3b75f392f371d5b9013c973e4fd1e6dbbe2 /modules/processing.py | |
parent | 35c45df28b303a05d56a13cb56d4046f08cf8c25 (diff) | |
download | stable-diffusion-webui-gfx803-44ab954fabb9c1273366ebdca47f8da394d61aab.tar.gz stable-diffusion-webui-gfx803-44ab954fabb9c1273366ebdca47f8da394d61aab.tar.bz2 stable-diffusion-webui-gfx803-44ab954fabb9c1273366ebdca47f8da394d61aab.zip |
Fix latent upscale highres fix #3888
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/processing.py b/modules/processing.py index 548eec29..f18b7db2 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -653,6 +653,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): if opts.use_scale_latent_for_hires_fix:
samples = torch.nn.functional.interpolate(samples, size=(self.height // opt_f, self.width // opt_f), mode="bilinear")
+ image_conditioning = self.txt2img_image_conditioning(samples)
else:
decoded_samples = decode_first_stage(self.sd_model, samples)
@@ -674,6 +675,12 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): samples = self.sd_model.get_first_stage_encoding(self.sd_model.encode_first_stage(decoded_samples))
+ image_conditioning = self.img2img_image_conditioning(
+ decoded_samples,
+ samples,
+ decoded_samples.new_ones(decoded_samples.shape[0], 1, decoded_samples.shape[2], decoded_samples.shape[3])
+ )
+
shared.state.nextjob()
self.sampler = sd_samplers.create_sampler_with_index(sd_samplers.samplers, self.sampler_index, self.sd_model)
@@ -684,11 +691,6 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): x = None
devices.torch_gc()
- image_conditioning = self.img2img_image_conditioning(
- decoded_samples,
- samples,
- decoded_samples.new_ones(decoded_samples.shape[0], 1, decoded_samples.shape[2], decoded_samples.shape[3])
- )
samples = self.sampler.sample_img2img(self, samples, noise, conditioning, unconditional_conditioning, steps=self.steps, image_conditioning=image_conditioning)
return samples
|