Nodes/ComfyUI-FFT-2D/CZP (Generate)
ComfyUI Node

CZP (Generate)

A zone plate, on demand

By NobutakaKuroki·Created about a month ago·Updated about a month ago· 1
CZP (Generate)
    • image
    height512
    width512
    max_rings32.0

    CZP (Generate) creates a Chirp Zone Plate - a test pattern that looks like a target of ever-tighter concentric rings, and that is to image processing what a test tone is to audio. Instead of hunting for a sample photo to feed your FFT pipeline, you generate one on the fly, with a known, controlled frequency structure. The name comes from the fact that the rings' spacing shrinks as you move outward, meaning the pattern's frequency content grows continuously with radius. Run one through ImageFFT2D and you get a near-textbook spectrum you can use to calibrate every other node in the pack.

    Why would a beginner care? Because it's the difference between "why does my filter look wrong?" and knowing it isn't the filter. The zone plate is the classic test chart for showing sampling, aliasing, and frequency response. Upscale it past its resolution and you'll see moiré - real, demonstrable aliasing. Run it through FFTCrossover and watch the rings literally thin out as the low band keeps only the center. It's the honest way to learn what each filter node does, because you already know exactly what the input contains.

    How it works

    It evaluates intensity = 0.5 + 0.5 * cos(2π · max_rings · r²) for every pixel, where r is the distance from the canvas center normalized per axis (so it's a circle on a square canvas, an ellipse on a non-square one, and r = 1 at the edge midpoints). Because the cosine's argument is quadratic in radius, the instantaneous frequency rises linearly with distance from the center - that's the chirp, and it's what makes the pattern so informative. The output is a single IMAGE, repeated across three channels so it behaves like a normal RGB image.

    The three inputs are height and width (both 1–8192, default 512) and max_rings - the number of rings from center to edge, default 32. The rings knob is the fun one: crank it to 100+ and the outer rings pile up so densely they approach the sampling limit, which is exactly the regime where aliasing shows up.

    Honest expectations

    This is a tool, not art. You're not going to hang a zone plate on the wall, and you shouldn't expect it to teach you about your images - only about the nodes. But as a diagnostic it's genuinely useful: test your whole FFT pipeline with a zone plate before you trust it with real photos, and you'll isolate node bugs from image-dependent weirdness in one step. It's also the fastest way to demo the pack to someone else, because the spectrum it produces is so clean it's basically the cover image for "what an FFT is."

    How to install it

    Same pack, same routine. ComfyUI Manager → search ComfyUI-FFT-2D → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/NobutakaKuroki/ComfyUI-FFT-2D
    

    Restart ComfyUI and it's in the fft category. No pip dependencies, no model files - pure numpy, consistent with the whole pack from Dr. Nobutaka Kuroki's Kobe University educational suite. The repo's lesson_workflows folder is built around this kind of learning-by-looking approach, and a zone plate feeding ImageFFT2DFFTMagnitudePreview is the single best five-minute introduction to the pack.

    Categoryfft

    Inputs (3)

    NameTypeDefaultDescription
    heightINT5121–8192
    widthINT5121–8192
    max_ringsFLOAT32.00.1–1000

    Outputs (1)

    NameTypeDescription
    imageIMAGE