Skip to content

Commit

Permalink
Fix inpainting mask shape assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJDick authored and hipsterusername committed Jun 25, 2024
1 parent c3f8c43 commit 6b1f620
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invokeai/backend/stable_diffusion/diffusers_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ def add_inpainting_channels_to_latents(
# Validate assumptions about input tensor shapes.
batch_size, latent_channels, latent_height, latent_width = latents.shape
assert latent_channels == 4
assert masked_ref_image_latents.shape == [1, 4, latent_height, latent_width]
assert inpainting_mask == [1, 1, latent_height, latent_width]
assert list(masked_ref_image_latents.shape) == [1, 4, latent_height, latent_width]
assert list(inpainting_mask.shape) == [1, 1, latent_height, latent_width]

# Repeat original_image_latents and inpainting_mask to match the latents batch size.
original_image_latents = masked_ref_image_latents.expand(batch_size, -1, -1, -1)
Expand Down

0 comments on commit 6b1f620

Please sign in to comment.