Nodes/MKRShift_Nodes/Image Split Grid
ComfyUI Node

Image Split Grid

Slice a big image into overlapping tiles for tiled processing — and stitch it back later

By criskb·Created 7 months ago·Updated 5 months ago· 0
Image Split Grid
  • image
  • tiles
  • split_info_json
  • summary
columns2
rows2
size_modepad
anchorcenter
overlap_px32
pad_modeedge
pad_value0.00

Big images break diffusion. Whether it's a high-res upscale, a stylize pass, or a detail-enhance step, trying to push a 4000×4000 image through a model that was trained on 1024×1024 is asking for seams, artifacts, and VRAM pain. The standard fix is tiling: cut the image into chunks, process each independently, stitch back together. That's the job MKRImageSplitGrid does on the way in - and its companion MKRImageCombineGrid does on the way out.

How it works

Give it an image batch plus columns and rows, and it cuts each frame into a columns × rows grid of equal tiles. Two details make this genuinely useful for tiled processing rather than just a crop tool:

Overlap. overlap_px (default 32) pads every tile on all sides with extra context from its neighbors. That means the model sees what's just beyond each tile's edge, so features that span tile boundaries get processed consistently. This is the difference between visible grid lines and a seamless reassembly, and it's the first control to bump if you see seam artifacts downstream.

Metadata. Every split emits split_info_json, a full description of the operation - tile sizes, canvas size, overlap, anchor, source window, original dimensions. MKRImageCombineGrid reads this to reconstruct the original perfectly, which is why the pairing works without you tracking any of the math by hand.

The remaining inputs handle edge cases: size_mode (pad keeps the whole image by padding to an even canvas; crop trims to the largest evenly divisible window), anchor picks where the padding/crop offset comes from (center, any corner or edge - nine options), and pad_mode/pad_value control how padded regions and overlap context are filled (edge, reflect, or constant).

Outputs

  • tiles - the flattened tile batch, in row-major order per source image. Feed it to your KSampler/detailer/upscaler stage.
  • split_info_json - the metadata string. Wire it straight across to MKRImageCombineGrid.
  • summary - a one-liner: source count, tile count, grid, core tile size, overlap.

Installing it

Part of the pack:

# ComfyUI Manager: search "MKRShift Nodes", install, restart.
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
# restart ComfyUI

No extra dependencies, no models.

The workflow and its traps

MKRImageSplitGrid → [process tiles] → MKRImageCombineGrid

The classic shape is split → run your model pass on the tile batch → combine. Two things to watch:

  • Keep the tile batch consistent through your processing stage. If your middle nodes resize, crop, or reorder the batch, the combine node's strict validation will throw a clear "tile size does not match split metadata" error. That's the pack being kind - better a loud error than a silently garbled reconstruction.
  • The combine node validates rows × columns divides the tile count evenly and checks source_batch against the metadata. If you drop or add tiles, you'll get a precise error naming the mismatch.

Also note the split processes the whole batch: a 4-image batch becomes 4× the tiles. If you want one specific frame split, feed it a single image. And when you just need a quick contact-sheet style grid for review rather than a lossless round-trip, remember this pair is built for reversible tiling - for pure display purposes the pack has separate batch-collage/review nodes.

CategoryMKRShift Nodes/Utility/Layout

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
columnsINT21–64
rowsINT21–64
size_modeCOMBOpad2 options: pad, crop
anchorCOMBOcenter9 options: center, top_left, top, top_right, left, right, +3
overlap_pxINT320–2048
pad_modeCOMBOedge3 options: edge, reflect, constant
pad_valueFLOAT0.000–1

Outputs (3)

NameTypeDescription
tilesIMAGE
split_info_jsonSTRING
summarySTRING