Nodes/MKRShift_Nodes/Texture Hex Tiles
ComfyUI Node

Texture Hex Tiles

Hex tiles without the seam — a procedural honeycomb pattern

By criskb·Created 7 months ago·Updated 5 months ago· 0
Texture Hex Tiles
    • image
    • mask
    • hex_tiles_info
    settings_json{"width":1024,"height":1024,"pattern_mode":"fill","hex_scale_px":84.0,"line_width":0.18,"softness":0.0,"contrast":1.15,"balance":0.0,"invert":false,"seed":67}

    Hex grids show up everywhere in material work - sci-fi plating, floor tiles, honeycomb, camouflage. But a hex grid is one of those patterns that's a genuine pain to tile by hand, because offset rows don't wrap cleanly. Texture Hex Tiles generates the grid procedurally with wrapping built in, so the honeycomb continues across the tile boundary without a step. It's the kind of boring, correct utility that saves you an afternoon.

    How it works

    procedural_hex_pattern draws a regular hexagonal lattice by computing the distance to the nearest hex center, then shaping that field into cell walls. The pattern_mode decides what the field is used for: fill (solid hex cells with defined edges, the default), lines (just the wall lines), centers (a field peaking at each hex center), and bevel (a soft chamfered look that's ready to double as a bump map). hex_scale_px sizes the cells, line_width controls how thin or fat the walls are, and softness blurs the edges - crank it if you want a molded, less printed-on look.

    It's all wrapped value noise in numpy, deterministic on seed, and - the key bit - the hex lattice is computed so that it wraps at the tile edges. Your 1024×1024 hex plate tiles cleanly, period.

    The inputs that matter

    One settings_json text box holds everything, per pack convention. The defaults run fine; you'll mostly touch:

    • pattern_mode - fill / lines / centers / bevel
    • hex_scale_px - cell size (84 px default)
    • line_width - wall thickness
    • softness - edge softness
    • seed - rotate the lattice phase
    • contrast / balance / invert

    Outputs: image (grayscale as RGB), mask (single-channel field - the bevel mode output makes a surprisingly good height map), and hex_tiles_info with resolved settings.

    Installing it

    Ships in MKRShift Nodes from criskb. ComfyUI Manager, search "MKRShift Nodes", or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/criskb/MKRShift_Nodes
    

    Restart ComfyUI; it's under MKRShift Nodes → Surface → Texture. No models or extra deps - numpy/Pillow/torch. The README's ffmpeg/slicer install notes are for other parts of the pack.

    Common gotchas

    New pack, no community lore, so the code is ground truth. The usual MKRShift traps: broken JSON silently reverts to defaults, and out-of-range values get clamped silently. Also worth knowing: line_width is a fraction relative to cell size, so if you scale the cells down you may need to nudge the width too. And if your hexes look pinched at the edges, you're seeing the wrapping at work - that's expected and correct, it's how the tile stays seamless.

    CategoryMKRShift Nodes/Surface/Texture

    Inputs (1)

    NameTypeDefaultDescription
    settings_jsonSTRING{"width":1024,"height":1024,"pattern_mode":"fill","hex_scale_px":84.0,"line_width":0.18,"softness":0.0,"contrast":1.15,"balance":0.0,"invert":false,"seed":67}

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    hex_tiles_infoSTRING