Nodes/Image Processing Suite for ComfyUI/Load Image (Remove Alpha)
ComfyUI Node

Load Image (Remove Alpha)

The loader that composites transparency onto white, so sprites stop leaking

By marcoc2·Created 2 years ago·Updated 5 months ago· 1
Load Image (Remove Alpha)
    • IMAGE
    image

    Load Image (Remove Alpha) does one thing, and it does it without ceremony: you give it a file path, it opens the image, flattens any transparency onto a white background, and hands you a clean opaque RGB tensor. That's it. If you've ever dragged a render or a sprite with transparent edges into a pipeline and watched dark or colored fringes bleed into everything downstream, this is the fix.

    ComfyUI's standard LoadImage will happily carry an alpha channel into your graph. That's usually what you want - until it isn't. Training datasets, compositing nodes, and some video pipelines quietly assume three-channel RGB, and a PNG with transparency can produce garbage or outright errors when it hits them. This node is the "just make it opaque, please" option: any alpha in the image is composited over solid white, the same way you'd paste a sticker on paper.

    The mechanism is trivial under the hood, and it's worth knowing because it explains the edge cases. The image is opened with PIL, forced to RGBA, then pasted onto a freshly created white RGB canvas using the alpha channel as the mask. Nothing fancy, no blending modes, no settable background color - white is baked in.

    Here's the gotcha that trips people up: the image input is a plain text path, not the usual file-picker dropdown you get from ComfyUI's standard loader. You type or paste an absolute path, or one relative to where ComfyUI runs from. If the path is wrong, the node's own validation stops you early with an "Image path does not exist" message rather than a cryptic traceback - which is friendlier than most, but the field being a bare string still surprises people on the first go.

    Output is a single IMAGE tensor, ready to wire into whatever expects RGB.

    One way to think about where this sits in the pack: its cousin Remove Alpha does the same composite, but it takes an IMAGE that's already inside your workflow and works across whole batches. This node is the "from disk" variant - when your source is a file, not a prior node's output.

    It's also worth noting the difference from the opposite operation: if you want to keep the transparency, don't use this node - use the standard loader and let the alpha flow through. Flattening is destructive and there's no way back once it's composited.

    Install is just the AnotherUtils pack: ComfyUI Manager (search for "AnotherUtils", pack title "Image Processing Suite for ComfyUI") or cd ComfyUI/custom_nodes && git clone https://github.com/marcoc2/ComfyUI-AnotherUtils, then restart. No requirements.txt, no model downloads, no extra Python packages - PIL, numpy and torch are already ComfyUI core. It's about as low-risk a node as the pack ships.

    Categoryimage/loaders

    Inputs (1)

    NameTypeDefaultDescription
    imageSTRING

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE