Skip to content

Commit

Permalink
[inpaint pipeline] fix bug for multiple prompts inputs (apple#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohu2015 authored Oct 26, 2022
1 parent b2e2d14 commit bd06dd0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ def __call__(
masked_image_latents = 0.18215 * masked_image_latents

# duplicate mask and masked_image_latents for each generation per prompt, using mps friendly method
mask = mask.repeat(num_images_per_prompt, 1, 1, 1)
masked_image_latents = masked_image_latents.repeat(num_images_per_prompt, 1, 1, 1)
mask = mask.repeat(batch_size * num_images_per_prompt, 1, 1, 1)
masked_image_latents = masked_image_latents.repeat(batch_size * num_images_per_prompt, 1, 1, 1)

mask = torch.cat([mask] * 2) if do_classifier_free_guidance else mask
masked_image_latents = (
Expand Down

0 comments on commit bd06dd0

Please sign in to comment.