Skip to content

fix: Resolve mask shape incompatibility issue in LAMA model with newer PyTorch versions#65

Open
Anson2048 wants to merge 1 commit into
chflame163:mainfrom
Anson2048:patch-1
Open

fix: Resolve mask shape incompatibility issue in LAMA model with newer PyTorch versions#65
Anson2048 wants to merge 1 commit into
chflame163:mainfrom
Anson2048:patch-1

Conversation

@Anson2048

Copy link
Copy Markdown

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