Nodes/ComfyUI-JakeUpgrade/Image Remove Alpha JK๐Ÿ‰
ComfyUI Node

Image Remove Alpha JK๐Ÿ‰

Image Remove Alpha JK flattens RGBA to RGB

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 146
Image Remove Alpha JK๐Ÿ‰
  • RGBA_image
  • RGB_image

ComfyUI happily carries RGBA images through the graph, but the moment one hits a node that expects RGB - a sampler's image input, a preview, most controlnet preprocessors - you get a dimension error that tells you nothing. Image Remove Alpha JK is the two-second fix: RGBA_image in, RGB_image out, alpha channel dropped. That's the entire node, and it's one of the most quietly valuable utilities in the pack.

The mechanism is as simple as it gets: each frame is converted through PIL and back (convert('RGB')), which discards the alpha channel and leaves a plain 3-channel tensor. Note what it doesn't do - it does not composite the image over a background. If you want a transparent PNG laid over a white or black backdrop, that's a different operation (the pack's background-removal group nodes handle that). This node just flattens the data so downstream RGB-only nodes stop complaining.

Why this keeps being necessary: transparent images are everywhere in ComfyUI workflows now - background-removal nodes, IPAdapter inputs, layers composited with masks. Most of those produce RGBA because alpha is how the transparency is carried. And every time you feed that into something RGB-only, you're one shape-mismatch error away from a stalled queue. Slipping this node in before a picky consumer is the defensive habit that saves you the debugging.

It was added way back in v1.2.1 and has never needed to change, which is the best compliment a utility node can get. It also works on a batch - each frame in an RGBA batch comes out as a corresponding RGB frame, so it's safe to put in front of video or multi-image nodes too.

Install. It's part of ComfyUI-JakeUpgrade:

cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
cd ComfyUI-JakeUpgrade
pip install -r requirements.txt

Or ComfyUI Manager โ†’ "JakeUpgrade". Windows portable: install.bat or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt. Restart. Light deps - no models.

Gotchas: it silently drops alpha rather than compositing, so if your image looks transparent-as-black downstream, that's expected behavior, not a bug - put a background before this node if you need a visible backdrop. And remember the inverse case: if a node needs RGBA and you feed it RGB, that's the missing-alpha error; this node only ever converts RGBAโ†’RGB. Pack rules: LOAD_DEPRECATED_NODES = True if JK nodes report missing, and disable ComfyUI MultiGPU per the README for CUDA-error avoidance.

Category๐Ÿ‰ JK/๐Ÿ›ฉ๏ธ Image

Inputs (1)

NameTypeDefaultDescription
RGBA_imageIMAGEโ€”

Outputs (1)

NameTypeDescription
RGB_imageIMAGEโ€”