FL Random Shape Generator
Synthetic shape images (and a matching latent) on demand
- vae
- image
- latent
Sometimes you don't need a diffusion model to give you an image - you need a bunch of clean, controllable geometric noise: circles, triangles, lines, scattered around a canvas in whatever color scheme you pick. FL_RandomShapeGenerator, from the sprawling Fill-Nodes pack (filliptm / Machinedelusions), is exactly that: a synthetic image generator that draws shapes rather than diffusing pixels, batched and seeded so you can reproduce a set.
The README calls the output "training-friendly," and that's the honest framing - this is the kind of node you reach for to bootstrap placeholder data, generate quick geometric test patterns for a downstream effect (a masking or detection pipeline, say), or just get colorful abstract backgrounds without spinning up a checkpoint.
How it works
It rasterizes num_shapes shapes per image, each a random size between min_shape_size and max_shape_size, drawn from whichever shape_types category you've selected, colored per color_mode, at a random opacity between opacity_min and opacity_max, over a chosen background_color. All of it is seeded, so the same seed reproduces the same scattering of shapes.
The inputs and outputs that matter
The dial you'll touch most is shape_types - all, or a narrower set like circles, triangles, lines, polygons, circles_rectangles, or geometric_only. Pair it with color_mode (random, vibrant, pastel, monochrome, warm, cool, grayscale) to steer the overall look without touching individual shape logic.
Beyond that: width/height (default 512, in steps of 64) and batch_size set canvas size and how many images come out at once; num_shapes (default 10) and the min_shape_size/max_shape_size pair control density and scale; opacity_min/opacity_max let shapes overlap semi-transparently instead of stacking as solid blocks; background_color (white/black/gray/random) sets the canvas; and seed (default 0) makes the whole thing reproducible.
There's one optional input, vae - plug a VAE in and the node also encodes the generated image, so the second output isn't empty. Outputs are image (IMAGE) and latent (LATENT); if you don't connect a VAE, you'll get an image but the latent output isn't meaningful, so only wire it downstream when you've actually supplied a VAE.
How to install it
Through ComfyUI Manager, search "Fill-Nodes" and install, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
pip install -r ComfyUI_Fill-Nodes/requirements.txt
then restart. This node is standard PIL/numpy drawing under the hood - no special dependency beyond what the rest of the pack already needs.
Common issues & troubleshooting
Latent output looks wrong or errors downstream. That's almost always a missing vae connection - the latent is only produced when you feed one in. If you're not using the latent, just leave it unwired and only take the image output.
Shapes overlapping into mud. With a high num_shapes and a wide opacity_min–opacity_max range, dense overlapping shapes can average out into a muddy blob rather than distinct forms. Lower num_shapes, tighten the opacity range, or push opacity_min up so shapes read more solidly.
Same seed, different-looking results across runs. Check that batch_size and width/height haven't changed between runs - the layout algorithm is seeded but still depends on canvas dimensions and batch position, so changing those shifts what a given seed produces.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–4096 | — |
| height | INT | 51264–4096 | — |
| batch_size | INT | 11–64 | — |
| num_shapes | INT | 101–100 | — |
| min_shape_size | INT | 205–500 | — |
| max_shape_size | INT | 15010–1000 | — |
| shape_types | COMBO | all | 9 options: all, circles, rectangles, triangles, ellipses, lines, +3 |
| color_mode | COMBO | random | 7 options: random, vibrant, pastel, monochrome, warm, cool, +1 |
| opacity_min | FLOAT | 0.300–1 | — |
| opacity_max | FLOAT | 1.000–1 | — |
| background_color | COMBO | white | 4 options: white, black, gray, random |
| seed | INT | 00–4294967295 | — |
| vaeopt | VAE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| latent | LATENT | — |