ComfyUI Node

chessboard

A checkerboard mask generator with a cautionary tale attached

By supElement·Created 9 months ago·Updated about 11 hours ago· 10
chessboard
    • image
    • mask
    • invert mask
    width512
    height512
    size_modeby_grid_size
    grid_size64
    rows8
    columns8
    shapesquare

    ChessboardPattern generates a black-and-white checkerboard image - that part is simple. The interesting part is why it exists, because the reason is a cautionary tale that tells you exactly when not to use it. It was built as a mask hack for Qwen-Edit style transfer: the editor re-emits the whole frame, so unedited regions drift and shift. The idea was to mask out half the image with a checkerboard, convert that region's style, then convert the inverted region in a second pass, hoping the mask would hold the untouched pixels still.

    It didn't quite work. The author's own README notes that the checkerboard pattern interferes with the model's object recognition - the hard-edged alternating regions confuse it enough that they abandoned the approach and built the BlackWhiteColor node instead, which splits the image into balanced black/white regions for the same two-pass trick.

    So: if you landed here hoping to fix Qwen-Edit pixel drift, you want BlackWhiteColor_Element, not this. But as a general-purpose pattern/mask generator it's still genuinely useful, and it's fun to play with.

    How it works

    You set the canvas with width and height (8–8192, so it'll do proper tiling textures as easily as small test grids), then pick how the cells are sized via size_mode:

    • by_grid_size - every cell is grid_size pixels square. Default 64 on a 512×512 canvas gives you 8×8 squares.
    • by_rows_and_cols - instead of sizing cells, you say rows × columns (both 1–1024) and let the cell size fall out.

    Then shape switches the cells between square, circle, triangle, and diamond. This is the hidden depth of the node - with a circle or diamond pattern you're not doing checkerboards at all, you're doing a regular geometric overlay mask, which is handy for tileable texture bases, stamped patterns, or anything where you need a repeating mask that isn't a plain grid.

    Outputs are image (the rendered pattern), plus mask and invert mask - so you can use the pattern directly as a conditioning or compositing mask, and the inverted version is already there for the second pass without an extra InvertMask node.

    Using it in a workflow

    The honest use case is as a mask source: wire the mask output into ConditioningSetMask or a compositing blend to apply edits or effects in a checkered pattern. If you're testing the two-pass style-transfer idea, both masks are right there - just know the author themselves walked away from it because the checkerboard confused the model. There's a real argument this node now mostly survives as a pattern tool and a museum piece, but "museum piece" undersells it - a repeating geometric mask is a thing people reach for more often than you'd think.

    Installing it

    It's part of the supElement/ComfyUI_Element_easy pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/supElement/ComfyUI_Element_easy.git
    

    Restart ComfyUI, or use ComfyUI Manager and search ComfyUI_Element_easy.

    Gotchas

    Keep shape at square if you actually need a checkerboard - the other shapes are neat but they're not what the two-pass technique expects. And remember the object-recognition issue is the whole reason the author moved on, so if a checkerboard-masked edit comes back with garbled subjects, that's the known failure mode, not a bug in your settings.

    CategoryElement_easy/image

    Inputs (7)

    NameTypeDefaultDescription
    widthINT5128–8192
    heightINT5128–8192
    size_modeCOMBOby_grid_size2 options: by_grid_size, by_rows_and_cols
    grid_sizeINT642–2048
    rowsINT81–1024
    columnsINT81–1024
    shapeCOMBOsquare4 options: square, circle, triangle, diamond

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    invert maskMASK