Smart Generate Image
A solid-color generator, and why you'll keep reaching for it
- get_image_size
- IMAGE
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 plusdark gray,orange,purple,brown,pink, and a specialtransparententry.alpha(0–1) anduse_alpha- whether the output carries an alpha channel and how opaque it is. Turnuse_alphaon and you get RGBA, which matters if you're compositing the result over something else. Picktransparentas 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 intoget_image_sizeand 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| color | COMBO | 15 options: red, green, blue, black, white, yellow, +9 | |
| alpha | FLOAT | 1.000–1 | — |
| use_alpha | BOOLEAN | true | — |
| widthopt | INT | 5121–8192 | — |
| heightopt | INT | 5121–8192 | — |
| get_image_sizeopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |