Nodes/Eden.art nodesuite/Eden_RGBA_to_RGB
ComfyUI Node Runs on cloud

Eden_RGBA_to_RGB

Kill the alpha channel before it kills your workflow

By edenartlabΒ·Created 3 years agoΒ·Updated 6 months agoΒ· 119
Eden_RGBA_to_RGB
  • images
  • images
β—„background_color0.00β–Ί

Every once in a while a node that reads like a no-brainer ends up being the fix for a bug you've been chasing for an hour. Eden_RGBA_to_RGB is that node. It takes images with an alpha channel - RGBA PNGs, images with transparency - and flattens them into plain RGB by compositing them over a background color. Nothing clever, nothing expensive, exactly what the name says.

The "why you need this" story: ComfyUI loads most things as RGB, but the moment you drag in a PNG with transparency, some parts of your graph (certain samplers, VAEs, image-save nodes, histogram matchers) can choke on a 4-channel tensor, or worse, silently drop the alpha and leave you with black where the transparency was. This node makes the flattening explicit and controllable.

It's part of eden_comfy_pipelines, Eden.art's MIT-licensed suite of 70+ nodes. You'll find it under Eden 🌱/transform.

The two things you set

  • images - an IMAGE tensor. It handles both 3-channel (RGB) and 4-channel (RGBA) inputs; if you feed it plain RGB, it just passes it through untouched, which makes it safe to drop into a pipeline unconditionally.
  • background_color - a float from 0 to 1, default 0. This is the color that shows through the transparent areas. 0 is black, 1 is white, and anything in between is a gray. For transparent logos on white cards, set this to 1; for dark-theme assets, 0.

One output, images, a clean 3-channel RGB tensor ready for anything downstream.

How it actually blends

Straightforward alpha compositing. For each pixel it computes alpha * foreground + (1 - alpha) * background, where the background is the flat color you picked. Fully opaque pixels are untouched; fully transparent ones become pure background; everything in between gets a proper blend. The result is clamped to 0–1 and stays on the same device and dtype as your input, so you're not paying for a CPU round-trip.

One thing worth knowing: there's no "transparent to white" automatic mode here. The background is a single grayscale value, not a color you can pick. If you need a specific RGB backdrop (say, a brand color behind an asset), you're better off compositing with a solid-color image node or an image overlay that takes an actual color. This node is for the 90% case - black or white backdrop.

Where you'll use it

  • Before feeding an image into a histogram matcher or an IP-adapter encoder, both of which generally want RGB.
  • Before VAE encoding an image that arrived with an alpha channel.
  • Right before a save node when you want transparent-looking whites actually rendered as white instead of black.

Installing it

Part of the standard Eden pack install - ComfyUI Manager (search "eden"), or:

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

Restart ComfyUI. This node is pure tensor math - no models, no API keys, no downloads. It's one of the pack's quiet little workhorses, and now that you know it exists, you'll spot half a dozen places you could have used it.

CategoryEden 🌱/transform

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEβ€”
background_colorFLOAT0.000–1β€”

Outputs (1)

NameTypeDescription
imagesIMAGEβ€”