RC Load Image (Alpha)
The loader that keeps transparency alive
- IMAGE
- MASK
ComfyUI's built-in LoadImage quietly flattens transparency in a way that bites anyone doing compositing: the RGB channels get baked, the alpha gets dumped to a mask output, and by the time you're compositing a cutout you've lost the thing that made it a cutout. RC_LoadImageWithAlpha is the pack's fix - it loads a PNG as RGBA, keeping the alpha channel live in the IMAGE tensor so your blend and layer-effect nodes actually see it. It's the "start a compositing workflow correctly" node in the RC Image Compositor suite.
How it works
It reads the file with PIL, converts to RGBA (preserving the existing alpha), and outputs two things:
- IMAGE - a
[1, H, W, 4]RGBA tensor. This is the important output: 4 channels means downstream nodes that understand alpha (all the RC compositing and layer-effect nodes) can blend it properly. - MASK - the alpha channel in mask form. Note the convention: it's
1 - alpha, so white = transparent areas, matching ComfyUI's built-in LoadImage behavior (white = where an action applies). If you feed this into an inpainting node, it'll target the transparent regions - which is usually exactly what you want for "fill in what's missing."
The one optional input, RGBA_mode (default on), forces a 4-channel output even for images that have no alpha - adding an opaque channel instead of leaving it as RGB. Turn it off only if you genuinely need the image to stay 3-channel.
It's a plain file-picker input, so you select your PNG from ComfyUI's input directory like any loader.
Installing it
ComfyUI Manager → search "RC Image Compositor" → install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kj863257/ComfyUI_RC_Image_Compositor
cd ComfyUI_RC_Image_Compositor
pip install -r requirements.txt
Dependencies: pillow, numpy, opencv-python. Nothing to download.
Where people get burned
- The MASK output is the transparency, not the opacity. It's
1 - alpha, so a fully transparent background reads as a white mask. If you expected the mask to highlight your subject, it won't - invert it (or just use the IMAGE output's alpha). - If your downstream node ignores alpha, this loader doesn't save you. Most non-RC nodes silently drop the 4th channel when they process an RGBA tensor. The whole point is to pair this with nodes that respect alpha - this same pack's compositor and layer effects.
RGBA_modeoff + RGB image = no alpha to work with. You asked for RGB, you get RGB. It's a mode for pipelines that choke on 4-channel tensors, not for cutout work.
This is the quiet hero of the compositing side of the pack. If you're bringing in PNG cutouts - from BiRefNet, from a background-removal workflow, from a sticker pack - load them with this node and everything downstream that respects alpha starts working the way it should.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| RGBA_modeopt | BOOLEAN | true | Force RGBA output. If no alpha, add opaque channel. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |