Animated Checkerboard (Purz)
A checkerboard that breathes
- image
A plain checkerboard is something you can draw in your sleep. An animated checkerboard - one where the squares ripple and warp frame by frame with mathematical precision - is the kind of thing you'd otherwise have to build out of a dozen math nodes. PurzAnimatedCheckerboard does exactly that: it generates a full sequence of frames, each a checkerboard whose tiles get modulated by a moving wave, and hands you the whole thing as a single IMAGE batch you can turn into a video or feed into a video model.
It's part of the Purz/Patterns/Animated family in ComfyUI-Purz, the utility pack by PurzBeats (a Comfy Org staffer). Same wave engine powers the animated stripes, polka dots, and noise nodes, so once you understand one, you understand all four.
How it works
Under the hood it's two textures being combined. First a base checkerboard at your chosen square_size. Then a wave texture - a grayscale ramp generated per frame with a phase that advances each frame, so it reads as motion when played back. The two are merged with a math operation, and the result is mapped onto a color ramp between color1 and color2. That's the whole trick: the wave texture animates, the checkerboard stays put, and their interaction is what makes the pattern look alive.
The wave engine has three knobs stacked together. wave_type picks the wave form - sine, cosine, square, triangle, sawtooth. wave_direction picks how it sweeps - horizontal, vertical, diagonal, radial. wave_shape is the shaping envelope (sine, square, triangle), which is a subtler thing that distorts how the wave moves. If that feels like a lot, just start with the defaults: sine/sine/sine, and change one knob at a time.
The inputs that matter
- width / height - canvas size, 64–4096, step 8. Keep it modest; this node renders one frame per frame_count.
- square_size - the checkerboard tile size (8–256).
- color1 / color2 - hex colors, e.g.
#FFFFFFand#000000. The color ramp blends between them. - frame_count - how many frames in the output batch, up to 300. This is your length control.
- wave_scale - the frequency of the wave, from 0.01 to 1. Lower = longer, slower ripples.
- math_operation - how the wave combines with the checkerboard:
add,subtract,multiply,divide,power,minimum,maximum, and a bunch more (sine, cosine, modulo…).addis the gentle default;maximumgives hard-edged, posterized waves. - wave_factor - the strength of the wave, 0–2. Zero = static checkerboard, so you can literally dial the animation down to nothing.
- reverse_phase - flips the direction of motion.
- color_ramp_type -
linear,ease,b_spline,cardinal, orconstant. This changes how the texture maps to the two colors -constantgives hard banding,linearis smooth.
The output is image, an IMAGE batch with one frame per frame_count. That's exactly the shape a video combiner (or the pack's own Media Extractor) expects.
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, and you're set. Requirements are OpenCV, Pillow, torch, numpy - nothing exotic, no model downloads. Modern ComfyUI gives you slider widgets for all the numeric knobs.
Where people get burned
The easy mistake is cranking frame_count and resolution at the same time - 300 frames at 4096×4096 is a lot of pixels and a long render, so prototype at 512 or 1024 and upscale if you need to. And math_operation values like divide and modulo can produce unexpected hard edges; if the output looks crunchy, that's the operation, not a bug. It's a fun knob to explore, but add or multiply are your safe starting points.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–4096 | — |
| height | INT | 51264–4096 | — |
| square_size | INT | 328–256 | — |
| color1 | STRING | #FFFFFF | — |
| color2 | STRING | #000000 | — |
| frame_count | INT | 301–300 | — |
| wave_type | COMBO | sine | 5 options: sine, cosine, square, triangle, sawtooth |
| wave_scale | FLOAT | 0.100.01–1 | — |
| wave_direction | COMBO | horizontal | 4 options: horizontal, vertical, diagonal, radial |
| wave_shape | COMBO | sine | 3 options: sine, square, triangle |
| math_operation | COMBO | add | 12 options: add, subtract, multiply, divide, power, minimum, +6 |
| wave_factor | FLOAT | 0.500–2 | — |
| reverse_phase | BOOLEAN | false | — |
| color_ramp_type | COMBO | linear | 5 options: linear, ease, b_spline, cardinal, constant |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |