Skip to content

Commit

Permalink
Fixed mask+masked_image in sd inpaint pipeline (#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 Dec 2, 2022
1 parent 769f0be commit 3ad49ee
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 3ad49ee

Please sign in to comment.