ComfyUI Node

Checkerboard Composer

The Checkerboard Composer that alternates them

By orion4d·Created about a year ago·Updated about a year ago· 3
Checkerboard Composer
  • img1
  • img2
  • IMAGE
tiles_x8
tiles_y8
tile_width128
tile_height128
tile_moderesize

The CheckerboardNode takes two images and lays them out as alternating squares, like a chessboard where the black squares are one picture and the white squares are another. Sounds trivial until you want it - the "two faces alternate in a grid" portrait, an A/B comparison of two generations, or a quick moiré-ish texture made from a pair of renders. It's the kind of tiny compositor you don't think to build yourself until you need it at 2am.

How it works

It's deliberately simple. Both input images get converted to PIL, each is turned into a tile of tile_width × tile_height, and then they're pasted alternately across a grid of tiles_x by tiles_y. The only real decision is tile_mode:

  • resize (default): both images are squashed to the tile size. Fast and foolproof, but if the two images have different aspect ratios you'll distort one of them.
  • crop: takes the top-left tile_width × tile_height rectangle out of each image untouched. No distortion, but you're trusting that the interesting part of each image lives in the top-left corner - it usually doesn't.

The output image is tiles_x * tile_width wide and tiles_y * tile_height tall, which is the one math you should do in your head before running. Eight tiles at 128px gives you a tidy 1024×1024. Forty tiles at 1024px each gives you a monster your next node won't appreciate.

The inputs that matter

  • img1, img2 (IMAGE): the two alternating tiles. That's the whole point - feed any two images.
  • tiles_x / tiles_y (default 8 each, range 1–128): how many squares across and down.
  • tile_width / tile_height (default 128, range 8–1024): the size of each square.
  • tile_mode (resize / crop): as above.

One IMAGE output, standard B×H×W×C float tensor. Wire it to a Save Image or into anything downstream that wants a composed image.

Install

This is one of eight nodes in the orion4d/illusion_node pack ("ComfyUI Illusion & Pattern Nodes"), all under the "illusion" category. Either grab it via ComfyUI Manager (search "Illusion") or:

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

Restart ComfyUI and you're done - the pack's only requirements are numpy, torch, and Pillow, which a stock ComfyUI already has. No model downloads, no extra Python packages, none of the dependency-hell that plagues bigger packs.

Common issues

The two things that actually bite people: distorted tiles and runaway output size. If your squares look stretched, either crop instead of resize or normalize both inputs to the same aspect ratio before this node. If ComfyUI chokes on the output, check your grid math - tiles_x * tile_width and tiles_y * tile_height are the final dimensions, and there's no clamp on the total. A 64×64 grid at 256px tiles is a 16384×16384 image that will happily eat your VRAM for lunch.

Also worth knowing: it's the sibling of the pack's PatternGenerator Checkerboard mode, but that one draws a synthetic board from two hex colors. Use this node when your "squares" are real images, the other when you just need a texture.

Categoryillusion

Inputs (7)

NameTypeDefaultDescription
img1IMAGE
img2IMAGE
tiles_xINT81–128
tiles_yINT81–128
tile_widthINT1288–1024
tile_heightINT1288–1024
tile_modeCOMBOresize2 options: crop, resize

Outputs (1)

NameTypeDescription
IMAGEIMAGE