Nodes/ComfyUI-GridSplit/Auto Grid / Stitch Advanced (multi-image)
ComfyUI Node

Auto Grid / Stitch Advanced (multi-image)

Stitch a 4×4 grid, then regenerate just one cell of it

By workordie·Created 2 months ago·Updated 2 months ago· 5
Auto Grid / Stitch Advanced (multi-image)
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image_11
  • image_12
  • image_13
  • image_14
  • image_15
  • image_16
  • grid
  • width
  • height
  • mask
rows2
cols2
modeauto
ratio3:4
megapixels4.0
scale_methodlanczos
mask_cells

If this pack has a flagship, this is it. You feed it up to 16 images - image_1 is top-left, row-major from there - it stitches them into a clean R×C grid at a target total size, and then it does the thing the other stitch nodes don't: it hands you a mask that lines up exactly with the grid, so you can regenerate one cell and leave the other fifteen pixel-identical. That last capability is a workflow people genuinely build around, and it's why you'd pick this over ComfyUI's built-in Stitch Images.

Auto vs. manual

The two modes cover the two ways people actually want grids to look:

  • auto - preserve every image, no cropping. This is exactly ComfyUI's built-in Stitch Images with match_image_size: each image is resized to share its neighbor's edge, aspect preserved, lanczos, no padding. Your inputs are different sizes and ratios? Doesn't matter - you still get one clean filled rectangle. Use this when content is king and you don't want to lose a single pixel of it.
  • manual - pick one target ratio (1:1, 3:4, 4:3, 2:3, 3:2, 4:5, 9:16, 16:9) and every image is center-cropped to it first, then tiled into a uniform grid. Cropping is always a center crop - it trims the long side, never distorts. Use this when you want every cell to be exactly the same shape, like a tidy 3:4 contact sheet. The ratio dropdown only exists in manual mode, which trips up exactly no one after the first five minutes.

The picker and the ports

Rows and columns are set with a 4×4 picker drawn inside the node: hover to preview a block, click to lock the layout. On this node, choosing a layout also adds or removes the image_i input ports to match - pick 2×1 and you get two inputs, pick 3×3 and you get nine, max 4×4 = 16. Leave a port empty and that cell renders as black, so a 2×2 grid with only three images just shows one black square instead of erroring out.

The mask: the reason to pick this node

Alongside grid, width, and height, the outputs include a mask. Encode the grid to a latent, pipe this mask into SetLatentNoiseMask, and a partial-denoise KSampler will regenerate only the cells you select while everything else stays exactly as it was. The mask_cells string decides which cells DENOISE - row-major, 1-indexed, e.g. 2,4-6 - and you can set it from the picker's mask toggle or type it by hand. Empty means "denoise everything," which makes a wired-but-unconfigured mask a harmless no-op.

This is classic masked-inpainting territory, and the reason it's still worth doing in 2026: a whole-frame edit model rewrites pixels you didn't touch, and the drift compounds across a chain of edits. A mask keeps the untouched cells bit-identical - the one thing instruction-editing models still can't promise. The pack README even lays out the natural loop: assemble scenes with this node → run the grid through an img2img pass → break it back apart with the sibling Carousel Split node.

The inputs that matter

mode, ratio (manual only), megapixels (target total grid size, default 4), scale_method (lanczos default), and the image_i ports themselves. That's genuinely the whole list - the defaults are good enough to just click a layout and start.

Install

No model files, no extra dependencies: torch and numpy only, both already present in ComfyUI. Install via ComfyUI Manager (search "GridSplit"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/workordie/ComfyUI-GridSplit

Restart ComfyUI, then hard-refresh the browser (Ctrl+Shift+R). The in-node picker is a frontend widget served from the pack's web/ folder, and a cached page won't show it - no picker and no dynamic ports after install means you skipped the reload, not that the node is broken.

Categoryimage/grid

Inputs (23)

NameTypeDefaultDescription
rowsINT21–4
colsINT21–4
modeCOMBOautoauto = preserve every image, no cropping (cells can differ). manual = center-crop every image to one ratio for a uniform grid.
ratioCOMBO3:4Manual mode only: the aspect every image is center-cropped to before stitching.
megapixelsFLOAT4.00.1–100Target TOTAL size of the stitched grid.
scale_methodCOMBOlanczos5 options: lanczos, bicubic, area, bilinear, nearest-exact
mask_cellsoptSTRINGCells to DENOISE for the MASK output (row-major, 1-indexed, e.g. '2,4-6'). Others are preserved. Empty = denoise all (mask is a no-op). Set via the picker's mask toggle, or by hand / from an app.
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE
image_9optIMAGE
image_10optIMAGE
image_11optIMAGE
image_12optIMAGE
image_13optIMAGE
image_14optIMAGE
image_15optIMAGE
image_16optIMAGE

Outputs (4)

NameTypeDescription
gridIMAGE
widthINT
heightINT
maskMASK