ComfyUI Node

Image to RGB

Drop the alpha channel when the rest of the graph can't handle it

By r-vage·Created about a year ago·Updated 5 months ago· 23
Image to RGB
  • images
  • image

ComfyUI mostly deals in RGB images, but a few producers hand you RGBA - an alpha channel riding along with the color data. Some image loaders, matting/background-removal output, and various compositing nodes emit it. The moment an RGBA image reaches a node that only understands RGB, you get dimension errors or silent weirdness. Image to RGB is the janitor: it converts every input image to plain RGB, discarding the alpha channel.

How it works

The node takes your images, converts each one through PIL's .convert('RGB'), and hands back a single RGB IMAGE. That's the whole mechanism - a channel drop, nothing fancier. It handles a batch too: every image in the input gets converted and re-stacked, so the output shape stays consistent with what you fed in.

Two things worth knowing about what "drop alpha" means. First, it's a hard drop - there's no compositing onto a background, no "flatten with white," no premultiply handling. If your image has semi-transparent pixels, they get their alpha simply discarded, which can leave the RGB values looking odd where the alpha wasn't 1.0. If you need transparency flattened onto a specific background, you want a proper flatten node, not this. Second, it's an RGB conversion, not an RGBA→RGBcompositing utility - for most ComfyUI graph use (feeding a VAE encode, a ControlNet preprocessor, a save node) that's exactly right.

When you'd reach for it

  • A background-removal node outputs RGBA and your next step (a depth preprocessor, say) chokes on four channels.
  • You loaded a PNG with transparency and a downstream node is throwing shape errors.
  • You want to be sure the rest of the graph sees clean RGB before a long pipeline run, instead of discovering the alpha halfway through.

What's on the node

  • images - the input IMAGE (single or batch).
  • image output - the same images as RGB.

One input, one output. If the input was already RGB, the conversion is a harmless pass-through.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI-RvTools_v2
# restart ComfyUI

Or search "ComfyUI-RvTools_v2" in ComfyUI Manager. No models; deps are the pack's standard torch/numpy/Pillow/opencv-python/pilgram.

The pack caveat

The README flags RvTools v2 as unmaintained and points to ComfyUI_Eclipse as the successor. The RvTools name also carries history - the original repo vanished from GitHub in early 2025, breaking workflows and spawning the "can anyone re-share it?" thread on r/comfyui. v2 is the renamed, still-installable version. For a tiny converter like this, the deprecation is trivia; for a legacy workflow that demands it, v2 is the repo to clone.

Category🫦 RvTools II/ Conversion

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
imageIMAGE