Nodes/ComfyUI-Image-Filters/Image Constant Color (RGB)
ComfyUI Node

Image Constant Color (RGB)

A solid color image, in one node, in floats not hex

By spacepxl·Created 3 years ago·Updated 8 months ago· 293
Image Constant Color (RGB)
    • IMAGE
    width512
    height512
    batch_size1
    red0.000
    green0.000
    blue0.000

    Sometimes you don't need a generated image at all - you need a flat, solid-colored one: a chroma-key background for compositing, a reference swatch to feed Color Match Image, a blank canvas the same size as your generation batch. Image Constant Color (RGB) does exactly that and nothing more. Set a width, height, and an RGB value, and it hands you an image filled with that color.

    It's the least glamorous node in this pack, and that's fine - utility nodes earn their keep by being boring and reliable, not by being interesting.

    The inputs

    • width / height (default 512, up to 8192) - image dimensions.
    • batch_size (default 1, up to 4096) - how many identical copies to output, useful if you need a solid-color batch that matches the batch size of whatever you're compositing it against.
    • red, green, blue (each default 0, range 0–1, step 0.001) - the color, as floats.

    That last part is the thing that trips people up: these are 0–1 floats, not 0–255. If you're used to picking colors as RGB(255, 0, 0) for pure red, that's red: 1, green: 0, blue: 0 here, not red: 255. Punch in 255 and you'll get a fully clipped, meaningless value - the node isn't going to rescale it for you.

    Output: one IMAGE, the solid-color batch.

    How to install it

    ComfyUI Manager: search "ComfyUI-Image-Filters", install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/spacepxl/ComfyUI-Image-Filters
    

    then restart. The pack depends on opencv-contrib-python; if you get a cv2 import error on startup, it's typically another custom node pack fighting over a different opencv version, not this one. On Windows the author ships install.bat / import_error_install.bat to reinstall a matching opencv set; on Linux/manual setups, uninstall the conflicting opencv packages and install opencv-contrib-python by itself. No models to fetch, no VRAM overhead - this node barely does any work.

    Common issues & troubleshooting

    Color comes out near-black even though you typed a "real" value. You almost certainly typed a 0–255 value into a 0–1 field. Convert: divide your 0–255 number by 255 (so 128 becomes ~0.5, 200 becomes ~0.78).

    Need a specific hue and it's fiddly to dial in via R/G/B. If you're chasing a specific color by feel rather than an exact RGB triple, the pack's HSV sibling - Image Constant Color (HSV) - is usually faster to work with, since hue/saturation/value maps more directly to how people describe color ("a bit more orange," "less saturated") than juggling three RGB sliders at once.

    Batch size mismatch downstream. If you're feeding this into a node that expects it to line up with your generation batch (like a per-frame reference for Color Match Image), remember to set batch_size to match - a batch of 1 solid color against a batch of 8 generated frames will just broadcast oddly or error, depending on the downstream node.

    CategoryImage-Filters/image

    Inputs (6)

    NameTypeDefaultDescription
    widthINT5121–8192
    heightINT5121–8192
    batch_sizeINT11–4096
    redFLOAT0.0000–1
    greenFLOAT0.0000–1
    blueFLOAT0.0000–1

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE