diff options
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/processing.py b/modules/processing.py index 23ee5e02..02292bdc 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -769,9 +769,12 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing): # Create another latent image, this time with a masked version of the original input.
conditioning_mask = conditioning_mask.to(image.device)
- conditioning_image = image
- if getattr(self, "inpainting_mask_image", shared.opts.inpainting_mask_image):
- conditioning_image = conditioning_image * (1.0 - conditioning_mask)
+ # Smoothly interpolate between the masked and unmasked latent conditioning image.
+ conditioning_image = torch.lerp(
+ image,
+ image * (1.0 - conditioning_mask),
+ getattr(self, "inpainting_mask_weight", shared.opts.inpainting_mask_weight)
+ )
conditioning_image = self.sd_model.get_first_stage_encoding(self.sd_model.encode_first_stage(conditioning_image))
|