Nodes/ComfyUI-SplitImage/Stitch Image Tiles
ComfyUI Node

Stitch Image Tiles

Stitch Image Tiles — the collector that makes tiling actually seamless

By QuigleyDown·Created 5 months ago·Updated 5 months ago· 0
Stitch Image Tiles
  • tiles
  • tiling_spec
  • IMAGE
rows0
columns0
overlap0

This is the node that makes the whole pack worth installing. Splitting an image into tiles is easy - any pack can do that. The hard part is putting it back together without a visible grid of seams, and that's Stitch Image Tiles' entire job. It's also a collector: instead of processing one tile and immediately emitting a result, it waits until every tile in your list has finished its downstream pass, then reassembles the full image. That waiting behaviour is what turns "process tiles one-by-one to save VRAM" from a nice idea into a working workflow.

How it works

The node is marked INPUT_IS_LIST in the source, which is ComfyUI's way of saying "gather everything, then run once." It concatenates all tiles, verifies the total is divisible by rows × columns (and raises a clear error if not), then blends.

The seamless part is a weight-normalized blending algorithm. In the overlap regions between tiles it applies linear ramps - a fade-in from one tile, a fade-out from the other - and accumulates both the weighted pixel values and the weights. At the end it divides pixel values by accumulated weights. So instead of averaging two tiles evenly (which gives you that ghosted double-exposure look on seams), the boundary gets a smooth crossfade, and the interior of each tile stays at full weight. It's the same family of trick Tiled Diffusion uses, done with a few dozen lines of PyTorch.

It also auto-detects upscaling. If your processed tiles come back bigger than the original tile size (say you ran an upscaler per tile), it computes the scale, scales the overlap to match, and crops the final output back to the original dimensions. That's a genuinely useful feature - it means tile-then-upscale-then-stitch just works without you reconfiguring anything.

Inputs that matter

Only tiles is required. If you wire in a tiling_spec (from Split Image into Tiles or Calculate Tiling Spec), the node reads the grid from it and you never touch rows/columns/overlap again. If you don't provide a spec, you must set rows and columns manually (defaults are 0, and 0 is an error). overlap only matters in the no-spec path too - with a spec it's taken from the dict. Rule of thumb: always pass the spec. It's the difference between "it worked" and "why is it complaining about 12 tiles not dividing by 9."

Common failure modes

The two you'll actually hit:

  • "Total tiles not divisible by rows*cols" - you changed the grid after splitting, or fed it an incomplete tile set. Reconnect the spec and this disappears.
  • Visible seams - the overlap was too small for the amount of change your sampler/upscaler made to each tile. Bump overlap up at the split node; this pack can only blend the seam, not hide that its neighbours diverged.

A quieter one: without a spec, the node assumes tiles weren't upscaled, so auto-upscale detection is off. Keep the spec wired and you get scale detection for free.

Installing it

ComfyUI Manager (search "ComfyUI-SplitImage") or:

cd ComfyUI/custom_nodes
git clone https://github.com/QuigleyDown/ComfyUI-SplitImage.git

Restart ComfyUI. Pure PyTorch, no extra dependencies, no model files. It's a small pack by QuigleyDown with almost no community presence - so if you're building something that has to be reliable, read the source (it's short) and test on a cheap image before trusting it with an hour-long 4K upscale.

CategorySplitImage

Inputs (5)

NameTypeDefaultDescription
tilesIMAGE
tiling_specopt*
rowsoptINT00–100
columnsoptINT00–100
overlapoptINT00–1024

Outputs (1)

NameTypeDescription
IMAGEIMAGE