diff options
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/processing.py b/modules/processing.py index 4efba946..f72185ac 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -783,7 +783,14 @@ 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 * (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))
# Create the concatenated conditioning tensor to be fed to `c_concat`
|