Skip to content

Commit

Permalink
added recommendation from AUTOMATIC1111#6074
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisYeoSj committed Nov 23, 2023
1 parent 5ef669d commit ebe1d78
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions modules/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,7 @@ def inpainting_image_conditioning(self, source_image, latent_image, image_mask=N
if torch.is_tensor(image_mask):
conditioning_mask = image_mask
else:
conditioning_mask = np.array(image_mask.convert("L"))
conditioning_mask = conditioning_mask.astype(np.float32) / 255.0
conditioning_mask = torch.from_numpy(conditioning_mask[None, None])

# Inpainting model uses a discretized mask as input, so we round to either 1.0 or 0.0
conditioning_mask = torch.round(conditioning_mask)
conditioning_mask = source_image.new_ones(1, 1, *source_image.shape[-2:])
else:
conditioning_mask = source_image.new_ones(1, 1, *source_image.shape[-2:])

Expand Down

0 comments on commit ebe1d78

Please sign in to comment.