Skip to content

Commit

Permalink
Fixed mask+masked_image in sd inpaint pipeline (huggingface#1516)
Browse files Browse the repository at this point in the history
* Fixed mask+masked_image in sd inpaint pipeline

Those were left unset when inputs are not PIL images

* Fixed formatting
  • Loading branch information
antoche authored and Thomas Capelle committed Dec 12, 2022
1 parent 6cb3811 commit 4e18e9e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ def __call__(
# 4. Preprocess mask and image
if isinstance(image, PIL.Image.Image) and isinstance(mask_image, PIL.Image.Image):
mask, masked_image = prepare_mask_and_masked_image(image, mask_image)
else:
mask = mask_image
masked_image = image * (mask < 0.5)

# 5. set timesteps
self.scheduler.set_timesteps(num_inference_steps, device=device)
Expand Down

0 comments on commit 4e18e9e

Please sign in to comment.