From c61a95f9f7852bcd9c679d96f1f42ace00782643 Mon Sep 17 00:00:00 2001 From: mara Date: Tue, 4 Jul 2023 16:30:17 +0200 Subject: [PATCH] Fix size check for conditioning mask The wrong dimensions were being checked, [1] and [2] are the image size. not [2] and [3]. This results in an out-of-bounds error if one of them actually matches. --- comfy/samplers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/samplers.py b/comfy/samplers.py index 3aaf8ac4..34df116c 100644 --- a/comfy/samplers.py +++ b/comfy/samplers.py @@ -375,7 +375,7 @@ def resolve_cond_masks(conditions, h, w, device): modified = c[1].copy() if len(mask.shape) == 2: mask = mask.unsqueeze(0) - if mask.shape[2] != h or mask.shape[3] != w: + if mask.shape[1] != h or mask.shape[2] != w: mask = torch.nn.functional.interpolate(mask.unsqueeze(1), size=(h, w), mode='bilinear', align_corners=False).squeeze(1) if modified.get("set_area_to_bounds", False):