diff options
author | random_thoughtss <random_thoughtss@proton.me> | 2022-10-25 11:14:12 -0700 |
---|---|---|
committer | random_thoughtss <random_thoughtss@proton.me> | 2022-10-25 11:14:12 -0700 |
commit | f9549d1cbb3f1d7d1f0fb70375a06e31f9c5dd9d (patch) | |
tree | 6fe546985ade8298e890190882cb87dcaed26ce3 /modules/processing.py | |
parent | 3e15f8e0f5cc87507f77546d92435670644dbd18 (diff) |
Added option to use unmasked conditioning image.
Diffstat (limited to 'modules/processing.py')
-rw-r--r-- | modules/processing.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/processing.py b/modules/processing.py index c61bbfbd..96f56b0d 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -768,7 +768,11 @@ 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)
+
+ conditioning_image = image
+ if shared.opts.inpainting_mask_image:
+ conditioning_image = conditioning_image * (1.0 - conditioning_mask)
+
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`
|