๐ Voronoi
Cellular mosaics that look like a cracked windshield
- image
- IMAGE
A Voronoi diagram is what you get when you scatter points and let every region claim the space closest to its seed - the pattern of a cracked windshield, dragonfly wings, bubbles, cells under a microscope. This node turns your image into that pattern, recoloring each cell from the photo behind it. It's the "organic mosaic" sibling of Polygon and Triangulate in the geometric family, and it's the one that looks least like a filter and most like a structure.
It's part of orion4d's Image Effects pack (Geometric category). Where Triangulate gives you sharp low-poly facets and Polygon gives you a tidy grid, Voronoi gives you irregular, organic cells - better for "texture" and "biological" moods than for portraits. Put a forest or a close-up of a face through it and you get something that reads as shattered or swarming, which is exactly why people reach for it.
The mechanism
The node scatters num_seeds points, builds the actual Voronoi tessellation with scipy, then for every pixel finds its nearest seed and paints it the color of that cell. Cell color comes from a small region of the original image around the seed (average mode), from the seed pixel itself (center_point), or from a random color per cell (random - the wild option that abandons the source photo entirely).
The inputs that matter:
- num_seeds (default 100, 10โ500) - cell count. 50โ150 is the recognizable-but-organic zone; past 300 the cells get tiny and the mosaic effect fades.
- color_mode -
average,center_point, orrandom.averagelooks like a melted version of your photo;randomlooks like a kaleidoscope threw up. - cell_outline + outline_color (black/white/adaptive) + outline_thickness - the grid lines.
adaptivepicks the line color per area, which is usually the most flattering. - seed_distribution -
random,edge_based(concentrates seeds along detected edges, keeping features readable), orgrid. Default israndom, butedge_basedis the better default for anything with a recognizable subject. - edge_threshold - sensitivity for the edge-based seed placement.
Output is a single IMAGE.
The performance trap
This is the slowest node in the pack, and it's not close. The cell-filling step runs a per-pixel Python loop, and for each pixel it computes the distance to every seed to find the nearest one. At 1024ร1024 with 100 seeds that's over a hundred million pure-Python operations - expect it to sit and think for a while. Mitigate by downscaling before the node or dropping num_seeds to the low end; the mosaic survives fine at 50. Pack-wide rules apply beyond that: CPU-only, and only the first frame of a batch is processed.
Install
ComfyUI Manager: search ComfyUI-Image-Effects. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/ComfyUI-Image-Effects.git
cd ComfyUI-Image-Effects
pip install -r requirements.txt
Restart, then right-click โ Add Node โ Image Effects โ Voronoi. No model downloads. This one needs scipy for the tessellation, so if you're installing dependencies by hand, keep scipy on the list along with numpy/OpenCV/Pillow.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | โ | |
| num_seeds | INT | 10010โ500 | โ |
| color_mode | COMBO | average | 3 options: average, center_point, random |
| cell_outline | BOOLEAN | true | โ |
| seed_distributionopt | COMBO | random | 3 options: random, edge_based, grid |
| outline_coloropt | COMBO | black | 3 options: black, white, adaptive |
| outline_thicknessopt | INT | 21โ5 | โ |
| edge_thresholdopt | FLOAT | 0.300.1โ1 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | โ |