Polka Dot Pattern (Purz)
Polka dots on demand, without opening a design tool
- image
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
#FFFFFFand#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_radiusis more than about half ofspacing, 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–4096 | — |
| height | INT | 51264–4096 | — |
| dot_radius | INT | 102–100 | — |
| spacing | INT | 4010–200 | — |
| background_color | STRING | #FFFFFF | — |
| dot_color | STRING | #000000 | — |
| stagger | BOOLEAN | true | — |
| batch_size | INT | 11–16 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |