ComfyUI Node

Remove Alpha Channel

Flatten an RGBA image onto white, already inside your graph

By marcoc2·Created 2 years ago·Updated 5 months ago· 1
Remove Alpha Channel
  • images
  • IMAGE

Remove Alpha Channel is the in-graph version of a job you'll hit constantly: you've got an image with transparency and the thing you're feeding it into doesn't want one. It takes an IMAGE tensor - wherever it came from in your workflow - and, if it has four channels, composites it over solid white. No alpha in the input? It passes the image through unchanged. That's the whole contract, and the pass-through behavior is genuinely useful: you can drop it into a pipeline unconditionally and it only does work when there's something to do.

Mechanically it's the same trick as the pack's path-based Load Image (Remove Alpha), but this node operates on data that's already in the graph and on the whole batch at once, not just a single file or first frame. It splits the RGBA tensor into RGB and alpha, then computes rgb * alpha + white * (1 - alpha) - per-pixel alpha blending onto a white background, exactly what "flatten onto white" means. Any partially transparent pixel gets a color mixed toward white in proportion to its transparency.

The realistic gotchas are about what "remove alpha" means here. The background is white, fixed, no option to choose black or a checkerboard. For sprites and renders meant for dark scenes, white flattening will leave a visible halo around translucent edges - if that matters, this isn't the node, you want a proper alpha-aware composite. Also note that ComfyUI's standard LoadImage keeps alpha in the tensor, so an RGBA PNG genuinely does arrive here with four channels; if you loaded through a node that already stripped it, this node just no-ops, which is fine and intended.

The one thing worth flagging is cosmetic but real: the node's source still contains debug prints that dump the input shape and value ranges to your console every run. It's the kind of leftover you see in hobbyist packs, and it means your terminal gets chatty when this fires. Harmless, ignorable, slightly untidy.

Where it fits: it's the finishing touch in compositing pipelines - before a Save Image that expects RGB, before feeding a three-channel-only VAE or upscaler, or as the "make sure it's opaque" guard at the end of a sprite pipeline. Paired with the pack's loaders it covers both ends: load-with-flatten from disk, or flatten-anything-already-loaded mid-graph.

Install is the standard AnotherUtils story: ComfyUI Manager → search "AnotherUtils", or cd ComfyUI/custom_nodes && git clone https://github.com/marcoc2/ComfyUI-AnotherUtils, then restart. Zero extra dependencies, zero model files - pure tensor math, which is exactly what a node this small should be.

Categoryimage/postprocessing

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE