Fill Alpha
Flatten a transparent image onto a solid color
- images
- image
A small, single-purpose node: if your image has a transparent (alpha) channel, this fills whatever's transparent with a solid color of your choosing and hands back a flattened image. That's the entire job.
Why you'd need this
Transparency shows up in ComfyUI workflows more often than beginners expect - background-removal steps (RMBG, BiRefNet, and similar) hand you back an image with the background cut to alpha rather than filled with anything. That's exactly what you want for compositing, but it's a problem the moment you need to hand that image to something that doesn't understand alpha: some save formats, some downstream nodes, and some samplers either ignore the alpha channel silently or choke on it outright. JPEG in particular has no concept of transparency at all - save a transparent PNG as JPEG without flattening it first and whatever was transparent typically turns solid black or some other unintended color, because the encoder has to pick something for those pixels.
Fill Alpha exists for that exact handoff moment: run your image through it before it reaches a JPEG save step, or before it goes into any node that expects a flat, fully-opaque image. It's a small node with one job, and it's worth keeping in mind alongside this pack's own To JPEG and Preview Image-JPEG nodes - if you're converting to JPEG downstream, flattening the alpha first with a color you actually chose beats letting an unpredictable default happen.
Inputs and outputs that matter
images(required) - the image (or batch) with a transparent region to fill.fill_color(required, string, default"0,0,0") - the color to fill transparent pixels with, given as comma-separated values (the default,0,0,0, is black). Change it to match whatever background color makes sense for your use - white for a clean product-shot backdrop, or a specific RGB triplet to match a brand color.
The output is a single image - fully opaque, ready for a save step or any node downstream that doesn't want to deal with alpha.
Installing it
ComfyUI Manager: search ComfyUI-ReplenishNodes, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/hben35096/ComfyUI-ReplenishNodes
No model downloads or extra dependencies documented for this node - it's a straightforward image operation.
Where people get tripped up
Getting the fill_color format wrong. It's a plain string field, not a color picker, so it's on you to type it correctly as comma-separated numbers - "0,0,0" for black, "255,255,255" for white. A malformed value (extra spaces, wrong separator, a hex code instead of comma-separated numbers) is likely to error rather than silently do something reasonable, since nothing in the schema suggests format tolerance.
Running this on an image that has no alpha channel to begin with. If your image is already fully opaque, this node has nothing to fill - expect it to pass the image through unchanged rather than do anything visible. If you're not sure whether a given step in your workflow actually produced transparency, that's worth checking before assuming this node isn't working.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| fill_color | STRING | 0,0,0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |