Nodes/ComfyUI-SmartImageTools/Smart Generate Image
ComfyUI Node

Smart Generate Image

A solid-color generator, and why you'll keep reaching for it

By slvslvslv·Created about a year ago·Updated 25 days ago· 2
Smart Generate Image
  • get_image_size
  • IMAGE
color
alpha1.00
use_alphatrue
width512
height512

A node that makes a flat rectangle of color sounds like the most boring thing in the pack. It isn't. Smart Generate Image is one of those utility nodes you reach for constantly once you realize how many workflows need a blank canvas with a specific color and size - as a backdrop to composite a cutout onto, a placeholder while you build a graph, or a color card to feed into masking and palette work.

It doesn't generate anything in the AI sense. It allocates a numpy array, fills it with the color you pick, and hands you a proper IMAGE tensor. No model, no prompt, no VRAM - it takes maybe a millisecond.

The inputs

  • color - a dropdown of 15 named colors: the basics plus dark gray, orange, purple, brown, pink, and a special transparent entry.
  • alpha (0–1) and use_alpha - whether the output carries an alpha channel and how opaque it is. Turn use_alpha on and you get RGBA, which matters if you're compositing the result over something else. Pick transparent as the color and the node forces alpha to 0 regardless.
  • width / height - both default to 512, up to 8192. But here's the trick worth knowing: wire an image into get_image_size and the node ignores your width/height and copies that image's dimensions exactly.

Output: one IMAGE, sized to your dimensions (or the reference image's), filled flat.

What you'd actually use it for

Composite work is the big one. Remove a background with SmartBackgroundRemove, generate a solid canvas, blend or paste - you now have a clean, predictable backdrop instead of whatever color the sampler happened to leave behind. It's also the fastest way to build a uniform test card when you're calibrating masks, or to create a blank frame of the right size when you're stitching video. And because get_image_size snaps to any image, it plays nice as a "match this size" helper in bigger graphs.

Installing it

It ships in the ComfyUI-SmartImageTools pack alongside the rest of these nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/slvslvslv/ComfyUI-SmartImageTools
pip install -r ComfyUI-SmartImageTools/requirements.txt

Restart ComfyUI afterward, or install "SmartImageTools" through ComfyUI Manager. The pack's real dependencies (scikit-learn, scikit-image, OpenCV, numba) are heavier than this node strictly needs - a solid-color fill only requires numpy - but they're shared with the pack's other nodes, so you get them either way.

Any gotchas?

Not really, which is refreshing. The only thing to remember is that use_alpha defaults to on, so don't be confused when you get RGBA and your downstream RGB-only nodes behave differently - and that the 15 named colors are fixed. If you need a precise hex color, that's what SmartColorFillMask or the palette nodes are for.

CategorySmartImageTools

Inputs (6)

NameTypeDefaultDescription
colorCOMBO15 options: red, green, blue, black, white, yellow, +9
alphaFLOAT1.000–1
use_alphaBOOLEANtrue
widthoptINT5121–8192
heightoptINT5121–8192
get_image_sizeoptIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE