Skip to content

Commit

Permalink
Fix size check for conditioning mask
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vmedea committed Jul 4, 2023
1 parent 8d694cc commit c61a95f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comfy/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c61a95f

Please sign in to comment.