From 6b1f6206ffa9b2f8e3691edd7c447df6d3e96a95 Mon Sep 17 00:00:00 2001 From: Ryan Dick Date: Tue, 25 Jun 2024 15:53:16 +0000 Subject: [PATCH] Fix inpainting mask shape assertions. --- invokeai/backend/stable_diffusion/diffusers_pipeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invokeai/backend/stable_diffusion/diffusers_pipeline.py b/invokeai/backend/stable_diffusion/diffusers_pipeline.py index fdcff7bd0d9..c25ccf4d2a6 100644 --- a/invokeai/backend/stable_diffusion/diffusers_pipeline.py +++ b/invokeai/backend/stable_diffusion/diffusers_pipeline.py @@ -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)