Nodes/ComfyUI Illusion & Pattern Nodes/Optical Illusion Generator
ComfyUI Node

Optical Illusion Generator

Checkerboards, circles, lines, and the spiral that makes your eyes water

By orion4d·Created about a year ago·Updated about a year ago· 3
Optical Illusion Generator
    • IMAGE
    illusion_typecheckerboard
    size512
    frequency10
    line_width3
    color1#FFFFFF
    color2#000000

    The OpticalIllusionNode generates the four classic "my eyes are lying to me" patterns - checkerboard, concentric circles, parallel lines, and an Archimedean spiral - as clean two-tone images. It's the simpler sibling of the pack's OpticalGeometricNode, and the spiral alone is worth the install: it's the classic "the whole picture is spinning" illusion, perfect as a hypnotic background or a canvas-filling motif.

    How it works

    Four separate drawing routines, all outputting a square image of size × size pixels in your two chosen colors:

    • checkerboard - the standard alternating grid. The humblest entry, and the one people least need a node for, but it's here for completeness.
    • circles - concentric rings from the center out, which is the classic "the center of the image is bulging toward me" illusion.
    • lines - parallel lines; dense enough they start to shimmer.
    • spiral - a proper Archimedean spiral, drawn parametrically. This is the crowd-pleaser. Stare at it, look away, and the wall moves.

    frequency controls how many elements exist (rings, lines, spiral turns), and line_width sets the stroke. It's all pure Pillow math - instant, no GPU, no models.

    The inputs that matter

    • illusion_type (default checkerboard): the four above.
    • size (default 512, range 128–2048): square output dimension.
    • frequency (default 10, range 2–100): how many rings, lines, or turns.
    • line_width (default 3, range 1–100): stroke thickness. Note this one goes to 100 - a thick-line spiral looks very different from a thin-line one, and both are good.
    • color1 / color2 (default #FFFFFF / #000000): the two-tone palette.

    One IMAGE output. Wire it to Save Image, or use it like the rest of the pack's generators - as a texture, a background, or a pattern input to the autostereogram node (the spiral genuinely shines there).

    Install

    Part of orion4d/illusion_node, "ComfyUI Illusion & Pattern Nodes", under the "illusion" category. Install via ComfyUI Manager by searching "Illusion", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/orion4d/illusion_node.git
    

    Restart ComfyUI. The pack depends only on numpy, torch, and Pillow - all already in a stock ComfyUI - so there are no model downloads and no extra package installs.

    Common issues

    The usual complaint is that the output "doesn't look like an illusion" - which almost always means the two colors are too close together, or frequency is too low to produce the vibration effect. High contrast (black on white) and a mid-to-high frequency are what make these read. Also note the output is square and there's no built-in crop, so for non-square uses you'll resize or crop downstream. And if you're comparing against the OpticalGeometricNode, the difference is style: that one does geometric design (starbursts, hexagons, wavy grids), this one does the four canonical illusion motifs. If you only install one, the spiral probably wins.

    Categoryillusion

    Inputs (6)

    NameTypeDefaultDescription
    illusion_typeCOMBOcheckerboard4 options: checkerboard, circles, lines, spiral
    sizeINT512128–2048
    frequencyINT102–100
    line_widthINT31–100
    color1STRING#FFFFFF
    color2STRING#000000

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE