Nodes/ComfyUI-Light-Tool/Light-Tool: SolidColorBackground
ComfyUI Node

Light-Tool: SolidColorBackground

A flat canvas in one node — and no, that default red is not a mistake

By ihmily·Created 2 years ago·Updated 4 months ago· 20
Light-Tool: SolidColorBackground
    • image
    width1024
    height1024
    color_hex#FF0000
    use_hextrue
    R255
    G255
    B255
    modeRGB
    alpha255

    Need a plain, flat image of a single color at a specific size? ComfyUI's core gives you EmptyImage (which is black unless you dig), but this node is the purpose-built one: pick dimensions, pick a color - hex or RGB - and out comes an IMAGE tensor filled with exactly that. The first time you wire one of these you'll probably be building a backdrop for a composite or reserving a canvas slot in a workflow, and it's the rare "generator" node that can't produce a bad result.

    The inputs that matter

    • width and height - canvas size, default 1024×1024.
    • color_hex - the hex color, default #FF0000 (red). This is the trap: it defaults to red, not white or black. If you fire this node up without touching it, you get a red square. That's deliberate but easy to forget.
    • use_hex - when true (default), the hex string wins and R/G/B are ignored. Flip it off to drive the color from the three ints instead.
    • mode - RGB, RGBA, or L (grayscale). Pick RGBA if you want alpha support.
    • alpha - only used in RGBA mode; 255 default means fully opaque, 0 gives you a fully transparent canvas.

    Output is a single image tensor at exactly width×height. One frame, so it's ready to be pasted under or composited onto.

    Why you'd reach for it

    Three genuinely useful jobs. First, compositing backdrops: pair it with the pack's Simple Image Overlay and you get a colored background of any size without loading a single asset. Second, canvas plumbing: some workflows need an image at a specific size to satisfy a downstream node, and a solid color is the cheapest possible placeholder. Third, product/teardown shots: transparent (alpha 0) or branded-color canvases under a subject, which is a common request in this pack's own demo material.

    For transparent-image work, remember the alpha trick: mode RGBA + alpha 0 produces a fully transparent 1024×1024 - the closest thing this pack has to "empty transparent canvas," since core ComfyUI doesn't hand you one directly.

    Installing it

    Part of ComfyUI-Light-Tool by Hmily. ComfyUI Manager → search "ComfyUI-Light-Tool" → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ihmily/ComfyUI-Light-Tool
    pip install -r requirements.txt
    # restart ComfyUI
    

    Pillow-only, no models, offline.

    Where people get burned

    • The red. Default #FF0000 catches everyone on first use. Change it to whatever you actually want before you run.
    • use_hex on but stale RGB values. Hex wins when the toggle is on - if you set R/G/B expecting them to apply, you'll wonder why the color never changes. Flip use_hex off.
    • L mode ignores alpha. Grayscale mode is literally a L image; there's no alpha channel there even if you set one.

    A boring node that does one thing exactly right. Once it's in your workflow, you'll never think about it again - which is the highest compliment a utility can get.

    CategoryComfyUI-Light-Tool/image/compositing

    Inputs (9)

    NameTypeDefaultDescription
    widthINT1024
    heightINT1024
    color_hexSTRING#FF0000
    use_hexBOOLEANtrue
    RINT2550–255
    GINT2550–255
    BINT2550–255
    modeCOMBORGB3 options: RGB, RGBA, L
    alphaINT2550–255

    Outputs (1)

    NameTypeDescription
    imageIMAGE