Nodes/ComfyUI_Fill-Nodes/FL Random Shape Generator
ComfyUI Node

FL Random Shape Generator

Synthetic shape images (and a matching latent) on demand

By filliptm·Created 3 years ago·Updated a day ago· 630
FL Random Shape Generator
  • vae
  • image
  • latent
width512
height512
batch_size1
num_shapes10
min_shape_size20
max_shape_size150
shape_typesall
color_moderandom
opacity_min0.30
opacity_max1.00
background_colorwhite
seed0

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_minopacity_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.

Category🏵️Fill Nodes/utility

Inputs (13)

NameTypeDefaultDescription
widthINT51264–4096
heightINT51264–4096
batch_sizeINT11–64
num_shapesINT101–100
min_shape_sizeINT205–500
max_shape_sizeINT15010–1000
shape_typesCOMBOall9 options: all, circles, rectangles, triangles, ellipses, lines, +3
color_modeCOMBOrandom7 options: random, vibrant, pastel, monochrome, warm, cool, +1
opacity_minFLOAT0.300–1
opacity_maxFLOAT1.000–1
background_colorCOMBOwhite4 options: white, black, gray, random
seedINT00–4294967295
vaeoptVAE

Outputs (2)

NameTypeDescription
imageIMAGE
latentLATENT