Hexagon Pattern (Purz)
Honeycomb, on demand
- image
Hexagons are the design world's favorite shape - the honeycomb layout shows up in game UI, sci-fi HUDs, and texture work constantly, and nobody wants to hand-draw it. PurzHexagonPattern generates a full honeycomb tile at any size, with filled or outlined cells, colored to taste, in one node. It's the pattern generator that makes you look more productive than you are.
It's from ComfyUI-Purz, the utility pack by PurzBeats (a Comfy Org staffer), and it's one of the Purz/Patterns/Basic nodes that generates a pattern from parameters alone - no image input needed.
How it works
The node lays out hexagons in a proper honeycomb grid using a staggered-row arrangement (every other row is offset by half a hex). Each hexagon is drawn as a six-vertex polygon: optionally filled with hexagon_color, optionally outlined with line_color at line_width. It computes the geometry with plain trig - hexagon_size is the radius, so the hex width is 2 × size and height is size × √3 - and tiles across the canvas until it's covered.
The inputs that matter
- width / height - canvas size, 64–4096.
- hexagon_size - 10–200, the radius of each hexagon. This is your scale control.
- line_width - 0–10. 0 turns the outline off entirely - set this to 0 along with
filledoff and you get nothing but background, which is a fun way to confuse yourself. - background_color / hexagon_color / line_color - the three hex colors. Background fills the gaps, hexagon_color fills the cells (when
filledis on), line_color draws the outlines. - filled - boolean, on by default. Fill the cells or leave them hollow with just outlines.
- batch_size - 1–16.
Output is image, an IMAGE at your requested size.
Installing it
ComfyUI Manager - search ComfyUI-Purz - or:
cd ComfyUI/custom_nodes/
git clone https://github.com/purzbeats/ComfyUI-Purz.git
cd ComfyUI-Purz
pip install -r requirements.txt
Restart ComfyUI. Requirements are OpenCV, Pillow, torch, numpy - all standard, no downloads beyond the pack.
Where people get burned
The default configuration is a genuine trap: hexagon_color defaults to #FFFFFF and filled defaults to on, while background_color is also #FFFFFF. That means out of the box you get white-on-white fills - the honeycomb only shows up as the black outlines, so if you expected solid hexagons and got a wireframe, that's the defaults doing their thing. Set hexagon_color to something different from the background and the cells suddenly appear. Also, unlike the grid node, the honeycomb intentionally extends past the canvas edges, so it doesn't tile edge-to-edge cleanly as a seamless texture - keep that in mind if you're building a repeating background.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–4096 | — |
| height | INT | 51264–4096 | — |
| hexagon_size | INT | 3010–200 | — |
| line_width | INT | 20–10 | — |
| background_color | STRING | #FFFFFF | — |
| hexagon_color | STRING | #FFFFFF | — |
| line_color | STRING | #000000 | — |
| filled | BOOLEAN | true | — |
| batch_size | INT | 11–16 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |