Nodes/ComfyUI-Purz/Hexagon Pattern (Purz)
ComfyUI Node

Hexagon Pattern (Purz)

Honeycomb, on demand

By purzbeats·Created about a year ago·Updated 3 months ago· 24
Hexagon Pattern (Purz)
    • image
    width512
    height512
    hexagon_size30
    line_width2
    background_color#FFFFFF
    hexagon_color#FFFFFF
    line_color#000000
    filledtrue
    batch_size1

    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 filled off 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 filled is 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.

    CategoryPurz/Patterns/Basic

    Inputs (9)

    NameTypeDefaultDescription
    widthINT51264–4096
    heightINT51264–4096
    hexagon_sizeINT3010–200
    line_widthINT20–10
    background_colorSTRING#FFFFFF
    hexagon_colorSTRING#FFFFFF
    line_colorSTRING#000000
    filledBOOLEANtrue
    batch_sizeINT11–16

    Outputs (1)

    NameTypeDescription
    imageIMAGE