Nodes/KJNodes for ComfyUI/Create Voronoi Mask
ComfyUI Node Runs on cloud

Create Voronoi Mask

An animated cellular-pattern mask

By kijai·Created 3 years ago·Updated about 20 hours ago· 2,930
Create Voronoi Mask
    • mask
    • mask_inverted
    frames16
    num_points15
    line_width4
    speed0.50
    frame_width512
    frame_height512

    This pack's other procedural animated-mask generator, CreateFluidMask, gives you something that flows like liquid. This one gives you a completely different visual language: a Voronoi diagram - cell boundaries drawn between a set of moving seed points - animated frame by frame. Where fluid reads as organic and smooth, Voronoi reads as geometric and fractured: think cracked earth, shattered glass, or a cell-membrane pattern, rather than a liquid pour. Good for stylized reveal transitions or as an abstract animated texture feeding some other effect.

    The inputs that matter

    • frames (default 16) - total output length.
    • num_points (default 15) - how many cell seed points are placed and animated.
    • line_width (default 4) - thickness of the lines drawn between cells.
    • speed (default 0.5, range 01) - how fast the seed points drift. Unlike most of this pack's other float sliders, which run all the way to 100, this one is capped at 1 - it's a normalized rate, not a raw pixel-per-frame value, so the visible range of change is compressed into that narrow band.
    • frame_width / frame_height (default 512 each) - output canvas size.

    Outputs: mask and mask_inverted - both handed to you directly as separate sockets. This node doesn't use an invert boolean the way this pack's other mask nodes do; instead you just pick whichever output you actually need.

    How to install it

    Via ComfyUI Manager: search KJNodes for ComfyUI, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kijai/ComfyUI-KJNodes
    pip install -r ComfyUI-KJNodes/requirements.txt
    

    Then restart. No models - a self-contained procedural generator.

    Common issues & troubleshooting

    The mask is mostly lines with barely any solid cell interior visible. Too many points relative to your frame size packs cells tightly together, and line_width starts to dominate the whole frame at that density. Drop num_points, line_width, or both.

    Turning up speed barely does anything. This slider is capped at 1, not 100 like several of this pack's other float parameters - small nudges near the top of its range are already close to the maximum rate, so don't expect the same kind of headroom you'd get out of, say, AddNoiseToTrackPath's strength slider.

    Looking for an invert toggle and not finding one. This node doesn't have one - it gives you mask and mask_inverted as two separate output sockets instead. Wire whichever one you actually need rather than searching the input list for a boolean.

    Pattern looks too static across the clip. Raise speed for more visible drift frame to frame, or increase frames relative to the cell count so the same motion has more room to read as animation rather than a near-static image with minor jitter.

    CategoryKJNodes/masking/generate

    Inputs (6)

    NameTypeDefaultDescription
    framesINT162–4096
    num_pointsINT151–4096
    line_widthINT41–4096
    speedFLOAT0.500–1
    frame_widthINT51216–4096
    frame_heightINT51216–4096

    Outputs (2)

    NameTypeDescription
    maskMASK
    mask_invertedMASK