fix: LayeredDiffusionDecodeRGBA broken in ComfyUI 0.19.3 (JoinImageWithAlpha API change)#137
Open
nAgi66629 wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ComfyUI 0.19.3 refactored
JoinImageWithAlphafrom a plain class with ajoin_image_with_alpha()method to the newio.ComfyNodeAPI (which usesexecute()instead). This causedLayeredDiffusionDecodeRGBAto crash at runtime with: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.