Nodes/ComfyUI_RaykoStudio/๐ŸฆŠ RS rgb2rgba
ComfyUI Node

๐ŸฆŠ RS rgb2rgba

Load a PNG and keep the transparency โ€” ComfyUI's Load Image quietly drops it

By RaykosanยทCreated about a year agoยทUpdated 5 days agoยท 79
๐ŸฆŠ RS rgb2rgba
    • rgba
    โ—„imageโ–พโ–บ

    ComfyUI's stock Load Image node silently discards the alpha channel - fine for most workflows, a real problem the second you're compositing. If you load a transparent PNG and paste it over something, you get a black box where the alpha was. ๐ŸฆŠ RS rgb2rgba (LoadImageRGBA) is the fix: it loads the image as RGBA and hands you a full four-channel tensor, alpha intact.

    How it works

    The source is short and honest. It lists the files in your ComfyUI/input folder (same as the native loader), opens the chosen one with Pillow, and if the mode isn't already RGBA it converts - an RGB JPEG becomes RGBA with alpha forced to 1.0 (fully opaque), and a transparent PNG or WebP keeps its real alpha. Then it normalizes to a [1, H, W, 4] float32 tensor in 0.0โ€“1.0 range, which is exactly ComfyUI's native IMAGE format plus a channel. It also implements IS_CHANGED by checking the file's mtime, so editing the source file in place refreshes the node's output on the next queue run.

    The name trips people up - it's a loader, not a converter, even though the display name says "rgb2rgba." If your input happens to have no alpha, you still get RGBA back; it's just opaque.

    Inputs and output

    • image - a dropdown of files in your ComfyUI/input directory (with the upload button, same as the native loader).
    • rgba - output IMAGE, a [1, H, W, 4] RGBA tensor, ready to feed anything that accepts ComfyUI images.

    How to install

    Part of ComfyUI_RaykoStudio:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Raykosan/ComfyUI_RaykoStudio.git
    

    Restart ComfyUI, or install via ComfyUI Manager (search "ComfyUI_RaykoStudio"). No extra dependencies beyond the pack's own (Pillow, torch, numpy).

    Common issues

    • "No files in list." The image must live in ComfyUI/input - the README calls this out explicitly. Use the upload button if you want to pick from elsewhere.
    • Alpha still lost downstream. Even though this node outputs RGBA, plenty of downstream nodes only read the first three channels. If you're compositing, check that the node you're feeding actually handles 4-channel input - RSCollage, for instance, is designed for it, but a generic SaveImage preview will show black where alpha is 0 unless the viewer honors it.
    • Huge file, slow load. TIFF with alpha is your friend for large transparent assets; giant PNGs load slower because Pillow has to decode the whole thing.

    The honest verdict: this is a tiny utility that fixes one specific, recurring pain - transparent overlays - and it's one of the pack's better "just works" nodes. If you've ever cursed a black rectangle where a logo should be, this is your node.

    Category๐ŸฆŠ RaykoStudio

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (1)

    NameTypeDescription
    rgbaIMAGEโ€”