Nodes/ComfyUI-Rennart/🎨 Rennart RGBA to RGB
ComfyUI Node

🎨 Rennart RGBA to RGB

The unglamorous fix for 'this node wants three channels'

By Rennart2025·Created 2 months ago·Updated 4 days ago· 4
🎨 Rennart RGBA to RGB
  • image
  • image
  • image_alpha

Why you'd have a four-channel image at all

Nothing in a normal txt2img graph produces alpha: images come out of a VAE as three channels and stay that way. Then you reach for one of the things that does make transparency - a background remover like BiRefNet or rembg, LayerDiffusion generating cutouts natively on SD 1.5/SDXL, a transparent-video model like Wan-Alpha, or a PNG with an alpha channel dragged through an image loader - and suddenly the graph is carrying a four-channel tensor.

That's where the trouble starts: almost everything downstream assumes three. The classic complaint is someone trying to upscale a cutout: Ultimate SD Upscale "has a 3 channel input, it refuses alpha channel", and VAE Encode for inpainting "also refuses 4 channel input". The reply in that same thread is the reason a node like this exists: Stable Diffusion can't handle alpha, because alpha is a compositing concept that belongs to pixel space. Latents have no slot for it. So you have to make a decision about that fourth channel, and converting is the cheap one.

How it works

The node looks at the last dimension of the tensor and dispatches:

  • 3 channels - returned untouched.
  • 4 channels - sliced to [..., :3]: the alpha plane is dropped and the RGB is kept as-is.
  • 1 channel - repeated three times, lifting greyscale to RGB.
  • More than 4 - the first three channels are kept.

That's the entire node, and it's worth being explicit about what it does not do, because that's the part that surprises people: it does not composite. It doesn't matte your cutout against white, doesn't fill transparent areas with any colour, doesn't give you a mask output. Whatever RGB sat underneath the alpha comes through unmodified - for most cutouts that's black, or whatever the remover left there. Perfect for satisfying a node that wants three channels. Not what you want if the goal was "subject, on a white background".

The inputs and output

There's exactly one of each, both typed IMAGE: one input named image, one output named image. No widgets, no dropdowns, no settings - nothing to configure, nothing to get wrong. Slot it between the transparency-producing node and the thing that's complaining: cutout → RGBA to RGB → VAE Encode, upscaler, save, whatever choked before.

Install

ComfyUI Manager: search ComfyUI-Rennart, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/Rennart2025/ComfyUI-Rennart
# restart ComfyUI

requirements.txt is torch and numpy - no models, no downloads, no heavy dependencies anywhere near this node.

Note that the README doesn't list this node (nor Audio Concatenate, nor a couple of siblings) - the pack's docs lag its code. Search the Add Node menu for "Rennart" or browse category Rennart/Image. Also: solo project, version 1.0.0, Russian tooltips and error strings, some other nodes forked by the author's own admission from WAS Node Suite and the Ideogram palette tools, MIT, and no meaningful community discussion of the pack anywhere I looked. For a thirty-line type-fixer that's not a red flag - read the file yourself. Just don't assume someone else already found its edges, because nobody has.

Traps worth knowing

Conversion is a one-way door. Once the alpha is gone it's gone; the RGB values under it were never "the image behind it". If you might need transparency later in the graph, pull the alpha out first - ComfyUI core's Split Image With Alpha splits an image into image + mask, and Join Image With Alpha puts a mask back as an alpha channel - or flatten onto the background you actually want with Image Composite Masked. Do that before you convert, not after.

Halos and fringes around cut edges. The anti-aliased edge pixels of a cutout are semi-transparent and still carry some of the original background's colour. While alpha is present, compositing hides that. Drop the alpha and those pixels show their true colours: a dark rim around hair, a bright rim around a sky-lit subject, mud around glass or smoke. No converter fixes this - better matting, or compositing over a matching colour, does.

A one-channel input comes out grey, not transparent. A black-and-white image gets repeated across R, G and B. Handy for previews, but if what you actually had was a mask, you're in the wrong place - route it through mask nodes instead of through here.

"It didn't do anything." On a three-channel image it's a pass-through by design, so silence is the right answer - check where you think the fourth channel is coming from. And don't judge by the preview: the canvas flattens alpha when it draws, so an RGBA cutout and its converted twin can look identical while only one of them loads into the next node. The test is whether the downstream error clears.

CategoryRennart/Image

Inputs (1)

NameTypeDefaultDescription
imageIMAGE—

Outputs (2)

NameTypeDescription
imageIMAGE—
image_alphaMASK—