RandomShapeGenerator
Throwaway test images without spinning up a model
- image
- bg_rgb
- fg_rgb
A developer's node, not an artist's. It draws a simple shape - a circle, triangle, hexagon, whatever - on a colored background and hands you the image. No model, no sampler, no VAE. The point is to get a real IMAGE into your graph instantly so you can test the plumbing downstream without waiting on a 30-second diffusion pass every single time.
If you build or debug workflows, you know the pain: you're wiring up an upscaler, a save node, a post-processing chain, and to test it you have to run a full generation over and over. This short-circuits that. Drop in a RandomShapeGenerator, wire it where a generated image would go, and iterate on the rest of the graph at zero GPU cost. It's the ComfyUI equivalent of a placeholder image, generated on the fly.
How it works
It procedurally paints one shape on a background and returns the result as a standard IMAGE tensor, exactly like a real generator would. Because the colors and shape can be randomized or pinned, you can produce either endless variety (for stress-testing a batch pipeline) or one fixed known image (for a reproducible test). It also reports the actual RGB values it chose, which is handy when the thing you're testing cares about specific colors.
The inputs and outputs
The controls:
widthandheight(default 512, in steps of 64) - canvas size. Match it to whatever your downstream nodes expect.shape_type-random, or a specific shape:circle,oval,triangle,square,rectangle,rhombus,pentagon,hexagon.bg_colorandfg_color- background and foreground, eachrandomor a named color (white,black,red,green,blue,yellow,cyan,magenta).seed- pin it for a reproducible image, randomize for variety on every run.
Two optional overrides: bg_color_override and fg_color_override - string fields for supplying an exact custom color when the named-color dropdown isn't enough.
Three outputs:
image(IMAGE) - the generated shape, wire it wherever a real image would go.bg_rgbandfg_rgb(STRING) - the exact RGB values that got used, so a test that checks color has a ground truth to compare against.
How to install it
ComfyUI Manager: search "ComfyUI Image Saver", install, restart.
Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/alexopus/ComfyUI-Image-Saver
cd ComfyUI-Image-Saver
pip install -r requirements.txt
then restart. No models, no heavy dependencies - it's just drawing shapes with Python.
Common issues & troubleshooting
You wanted a real generated image. This is the big one: RandomShapeGenerator is a testing utility. It does not run a diffusion model and will never produce anything resembling a prompt. If you dropped it in expecting art, you want a KSampler and a checkpoint instead. This node exists to test the wiring around them.
Same image every run. A fixed seed reproduces the same shape and colors by design - that's the point when you need a stable test fixture. Set the seed to randomize if you want it changing each run.
Override color ignored. The bg_color_override / fg_color_override fields are for exact custom colors beyond the named list. If you set an override but the named dropdown is still driving the output, double-check the override string is a value the node can parse - leaving it blank falls back to the dropdown.
Downstream size mismatch. The width/height step is 64, so dimensions land on multiples of 64. If a downstream node is fussy about exact sizes, set width and height here to match what it expects rather than assuming a default 512 fits.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–4096 | Width of the generated image in pixels |
| height | INT | 51264–4096 | Height of the generated image in pixels |
| bg_color | COMBO | Background color preset or random | |
| fg_color | COMBO | Foreground shape color preset or random | |
| shape_type | COMBO | Type of shape to generate or random | |
| seed | INT | 00–18446744073709550000 | Random seed for reproducible shape generation |
| bg_color_overrideopt | STRING | Override background color with hex (#AABBCC) or RGB(r, g, b) format | |
| fg_color_overrideopt | STRING | Override foreground color with hex (#AABBCC) or RGB(r, g, b) format |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Generated image with random shape |
| bg_rgb | STRING | Background color as RGB/hex |
| fg_rgb | STRING | Foreground color as RGB/hex |