Fill with Color
Fill with Color
- image
- mask
- image
fill_with_color paints a solid color into the masked area of an image. You give it an image, a mask, and an RGBA color, and it fills wherever the mask says to fill. Simple, and more useful than it sounds.
Why you'd reach for it
Flat color fills come up constantly once you start doing masked work. You've removed a background and want to drop the subject onto a solid color instead of transparency. You want to blank out a region before an inpaint so the model isn't anchored to whatever was there. You need a solid-color plate to composite against, or a quick color card, or to knock out a distracting element with a neutral fill before a refine pass. All of those are one node here instead of a detour through an external editor.
It pairs naturally with a background-removal or segmentation step: that gives you the mask, and fill_with_color gives you the backdrop. And because it takes an alpha value, you can do a semi-transparent tint over a region rather than a hard fill when that's what you want.
How it works
It fills the masked region of the input image with the color you specify as separate red, green, blue, and alpha channels, each 0–255. White areas of the mask get the color; black areas keep the original image. The alpha channel controls how opaque the fill is, so A at 255 is a solid replace and lower values blend the color into what's underneath.
The inputs that matter
- image - the base image you're filling into.
- mask - where to fill. White = filled, black = untouched.
- R / G / B - the fill color, 0–255 each. Default is 0/0/0 (black).
- A - opacity of the fill, 0–255. Defaults to 255 (fully opaque). Drop it for a translucent tint.
The output is a single image with the fill applied.
Installing it
ComfyUI Manager → search antrobots ComfyUI Nodepack, install, restart. Or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/antrobot1234/antrobots-comfyUI-nodepack
No models or dependencies to fetch.
Common issues
The main thing to get right is the mask polarity. This fills where the mask is white. If it's filling the exact opposite of what you wanted - coloring the subject instead of the background - your mask is inverted; flip it upstream (many mask nodes have an invert toggle, or use an "invert mask" node). Preview the mask first if you're unsure; this pack's Preview Mask node is there for exactly that.
Second, remember the color is 0–255 per channel, not a hex string or a 0–1 float. If your fill is coming out near-black when you asked for a mid color, double-check you're feeding values in the 0–255 range.
And if the fill looks faint or see-through when you wanted solid, check A - an alpha below 255 blends the color with the original instead of replacing it.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| R | INT | 00–255 | — |
| G | INT | 00–255 | — |
| B | INT | 00–255 | — |
| A | INT | 2550–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |