Nodes/ComfyUI-Purz/Animated Checkerboard (Purz)
ComfyUI Node

Animated Checkerboard (Purz)

A checkerboard that breathes

By purzbeats·Created about a year ago·Updated 3 months ago· 24
Animated Checkerboard (Purz)
    • image
    width512
    height512
    square_size32
    color1#FFFFFF
    color2#000000
    frame_count30
    wave_typesine
    wave_scale0.10
    wave_directionhorizontal
    wave_shapesine
    math_operationadd
    wave_factor0.50
    reverse_phasefalse
    color_ramp_typelinear

    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. #FFFFFF and #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…). add is the gentle default; maximum gives 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, or constant. This changes how the texture maps to the two colors - constant gives hard banding, linear is 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.

    CategoryPurz/Patterns/Animated

    Inputs (14)

    NameTypeDefaultDescription
    widthINT51264–4096
    heightINT51264–4096
    square_sizeINT328–256
    color1STRING#FFFFFF
    color2STRING#000000
    frame_countINT301–300
    wave_typeCOMBOsine5 options: sine, cosine, square, triangle, sawtooth
    wave_scaleFLOAT0.100.01–1
    wave_directionCOMBOhorizontal4 options: horizontal, vertical, diagonal, radial
    wave_shapeCOMBOsine3 options: sine, square, triangle
    math_operationCOMBOadd12 options: add, subtract, multiply, divide, power, minimum, +6
    wave_factorFLOAT0.500–2
    reverse_phaseBOOLEANfalse
    color_ramp_typeCOMBOlinear5 options: linear, ease, b_spline, cardinal, constant

    Outputs (1)

    NameTypeDescription
    imageIMAGE