Skip to content

fix: LayeredDiffusionDecodeRGBA broken in ComfyUI 0.19.3 (JoinImageWithAlpha API change)#137

Open
nAgi66629 wants to merge 1 commit into
huchenlei:mainfrom
nAgi66629:fix/join-image-with-alpha-api-0-19-3
Open

fix: LayeredDiffusionDecodeRGBA broken in ComfyUI 0.19.3 (JoinImageWithAlpha API change)#137
nAgi66629 wants to merge 1 commit into
huchenlei:mainfrom
nAgi66629:fix/join-image-with-alpha-api-0-19-3

Conversation

@nAgi66629
Copy link
Copy Markdown

Problem

ComfyUI 0.19.3 refactored JoinImageWithAlpha from a plain class with a join_image_with_alpha() method to the new io.ComfyNode API (which uses execute() instead). This caused LayeredDiffusionDecodeRGBA to crash at runtime with:

AttributeError: 'JoinImageWithAlpha' object has no attribute 'join_image_with_alpha'

Fix

Replace the call to JoinImageWithAlpha().join_image_with_alpha(image, alpha) with direct torch tensor concatenation along the channel dimension, which is functionally equivalent and has no dependency on ComfyUI's internal node API.

`python

Before

return JoinImageWithAlpha().join_image_with_alpha(image, alpha)

After

import torch
batch_size = min(len(image), len(alpha))
out_images = []
for i in range(batch_size):
out_images.append(torch.cat((image[i][:, :, :3], alpha[i].unsqueeze(2)), dim=2))
return (torch.stack(out_images),)
`

Testing

Verified with ComfyUI 0.19.3 + Animagine XL 4.0 using LayeredDiffusionApply (SDXL, Conv Injection) ? KSampler ? VAEDecode ? LayeredDiffusionDecodeRGBA. Node completes successfully and outputs a correct RGBA image.

ComfyUI 0.19.3 refactored JoinImageWithAlpha from a plain class with a
join_image_with_alpha() method to the new io.ComfyNode API, which uses
an execute() method instead. This broke LayeredDiffusionDecodeRGBA with:

  AttributeError: 'JoinImageWithAlpha' object has no attribute 'join_image_with_alpha'

Replace the call with direct torch tensor concatenation (cat along the
channel dim), which is equivalent and has no dependency on the internal
ComfyUI node API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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