Skip to content

Conversation

@Anson2048
Copy link

After upgrading PyTorch, the mask array shape became (H, W, 1, 1), which is incompatible with the image array shape (H, W, 3) during broadcasting. This caused the error: "ValueError: operands could not be broadcast together".

The fix adds shape validation and adjustment to ensure the mask is always in (H, W, 1) format before blending operations.

Location: _pad_forward method in iopaint/model/base.pynd adjustment to ensure the mask is always in (H, W, 1) format before blending operations.

…r PyTorch versions

After upgrading PyTorch, the mask array shape became (H, W, 1, 1), which is incompatible with the image array shape (H, W, 3) during broadcasting. This caused the error: "ValueError: operands could not be broadcast together".

The fix adds shape validation and adjustment to ensure the mask is always in (H, W, 1) format before blending operations.
lldacing added a commit to lldacing/ComfyUI_LayerStyle_Advance that referenced this pull request Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant