mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
Switch to a continous blend for cond. image.
This commit is contained in:
@@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user