Convert RGBA to RGB π ReActor
Drop the alpha channel that breaks nodes
- image
- IMAGE
Some node downstream just threw a shape or channel error, and the culprit is an image carrying a fourth channel it wasn't expecting. Convert RGBA to RGB (class ImageRGBA2RGB) is the one-line fix: it strips the alpha channel off an image, turning 4-channel RGBA into plain 3-channel RGB. That's the entire node. No settings, no models, no fuss - image in, flattened image out. It's the least glamorous node in the ReActor pack and one of the most quietly useful, which its click-through rate agrees with: for a utility this boring, people who find it tend to actually need it.
Why does this come up at all? Plenty of sources hand you RGBA - PNGs with transparency, background-removal nodes, screenshots, the output of a masking step. And plenty of downstream nodes assume RGB and choke on that extra channel, or silently do the wrong thing with it. Face analysis and swapping in particular want clean 3-channel input; an alpha channel that's all-empty or half-defined is exactly the kind of thing that produces a cryptic error three nodes later. This node makes the mismatch go away.
How it works
An RGBA image has four channels per pixel: red, green, blue, and alpha (opacity). RGB has three. ImageRGBA2RGB discards the alpha channel and returns the color data as a standard 3-channel image. It doesn't composite the transparency onto a background or do anything clever with partial opacity - it drops the channel. Conceptually it's the opposite of the problem the pack fixed in its own Masking Helper back in 0.5.0, where an empty alpha channel on a node's IMAGE output was causing errors with other nodes; this node is the general-purpose tool for the same class of headache.
The inputs and outputs that matter
It doesn't get simpler:
image- the image to flatten. If it's already RGB, nothing meaningful changes; if it's RGBA, the alpha is removed.
The single output is IMAGE, now guaranteed 3-channel RGB. Drop it inline right before whatever node was complaining - a swap node, a save node, an analyzer - and the channel-count mismatch is gone.
How to install it
It ships inside the ReActor pack, so installing ReActor gives you this node even though it has nothing to do with faces. ComfyUI Manager: Install Custom Nodes, search ReActor, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Gourieff/comfyui-reactor-node
then run install.bat / install.py and restart. This node itself has zero dependencies and downloads nothing - it's pure tensor manipulation. (The pack's heavy InsightFace install is for the swap nodes; this utility doesn't touch it.)
Common issues & troubleshooting
A downstream node errors about channels, shapes, or "expected 3 got 4." That's the exact case this node exists for. Insert it between the RGBA source and the node that's failing. Nine times out of ten that's the whole fix.
My transparency is gone / the background turned black or opaque. Working as intended - this node removes alpha, it doesn't preserve or composite it. If you need to keep transparency, this is the wrong tool; if you needed the transparent areas filled a specific color, composite the image over a solid background first, then convert.
It didn't fix my problem. Then the issue wasn't an alpha channel. Check whether the real mismatch is a batch dimension, a mask being passed where an image is expected, or a data-type problem - this node only addresses the RGBA-to-RGB case and nothing else.
The node isn't in the menu. If the whole ReActor pack failed to load, that's the InsightFace dependency failing to build (the recurring Visual Studio / C++ toolchain issue) - even though this node doesn't need InsightFace, an import failure elsewhere in the pack can take the whole set down. Fix InsightFace with the prebuilt wheel the README links for your Python version, restart, and the utility nodes come back with it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |