Added option to use unmasked conditioning image.

This commit is contained in:
random_thoughtss
2022-10-25 11:14:12 -07:00
parent 3e15f8e0f5
commit f9549d1cbb
2 changed files with 6 additions and 1 deletions

View File

@@ -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`