Nodes/ComfyUI-Purz/Polka Dot Pattern (Purz)
ComfyUI Node

Polka Dot Pattern (Purz)

Polka dots on demand, without opening a design tool

By purzbeats·Created about a year ago·Updated 3 months ago· 24
Polka Dot Pattern (Purz)
    • image
    width512
    height512
    dot_radius10
    spacing40
    background_color#FFFFFF
    dot_color#000000
    staggertrue
    batch_size1

    Sometimes you just need a clean polka-dot texture and you don't want to alt-tab to a design tool, export a PNG, and drag it into input/. PurzPolkaDotPattern generates one as a real IMAGE output right in the graph - set colors and spacing, hit run, and you've got a texture you can composite over a render, use as an img2img source, or pipe into a mask operation.

    It's part of purzbeats' ComfyUI-Purz pack, and it's about as no-frills as nodes get: no models, no weights, no downloads. You feed it numbers, you get pixels.

    How it works

    Under the hood it's plain Pillow drawing. The node lays down a grid of circles with ImageDraw.ellipse, starting each row offset by half the spacing when stagger is on - that's the classic "brick" polka-dot layout you see on wrapping paper and retro tees, where dots in alternate rows sit between the dots above them. With stagger off you get the straight rows-and-columns version.

    The inputs that matter

    • width / height - output size, 64–4096 (step 8, so keep them multiples of 8 if you're feeding a latent later).
    • dot_radius - 2–100, default 10. Bigger than that and dots start overlapping into blobs.
    • spacing - 10–200, default 40, the gap between dot centers. This is the real "density" dial.
    • background_color / dot_color - hex strings like #FFFFFF and #000000. Two-color only; no gradients here.
    • stagger - boolean, default on. Off gives you the aligned grid.
    • batch_size - 1–16. Bump it if you're generating a stack of identical textures for a video or batch workflow.

    Output is a single image (IMAGE), one tensor per frame in the batch.

    Install

    It ships in the same pack as the rest of the Purz nodes:

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

    then restart ComfyUI. Or just search "ComfyUI-Purz" in ComfyUI Manager. No model files, no API keys - the heaviest dependency is OpenCV, which you almost certainly already have.

    Where people get burned

    • Hex format matters. It parses #RRGGBB; drop the # or use a short form and you'll get colors the node doesn't understand. Keep the #.
    • Radius vs. spacing. If dot_radius is more than about half of spacing, the dots mush together - sometimes that's the look you want, but it catches people off guard when they expected dots and got a dotted field.
    • Batch frames are identical. With batch_size > 1 every frame is the same pattern; there's no seed to vary them. For actual animation you want the pack's animated polka dot node, which is a separate class.

    Honestly, that's the whole node. If you need a dot texture as part of a workflow, it saves you the round-trip; if you need dots that move, look at Animated Polka Dot Pattern instead.

    CategoryPurz/Patterns/Basic

    Inputs (8)

    NameTypeDefaultDescription
    widthINT51264–4096
    heightINT51264–4096
    dot_radiusINT102–100
    spacingINT4010–200
    background_colorSTRING#FFFFFF
    dot_colorSTRING#000000
    staggerBOOLEANtrue
    batch_sizeINT11–16

    Outputs (1)

    NameTypeDescription
    imageIMAGE