Nodes/IG Interpolation Nodes/🧩 IG Stitch Images (Simple)
ComfyUI Node

🧩 IG Stitch Images (Simple)

A greedy, no-warp stitcher for tiles that only slid sideways

By IDGallagherΒ·Created 3 years agoΒ·Updated about a year agoΒ· 3
🧩 IG Stitch Images (Simple)
  • images
  • stitched
β—„blend_width_px64β–Ί
β—„max_iter150β–Ί
β—„eps_exponent-6β–Ί
β—„cc_threshold0.80β–Ί

IG Simple Translate Stitcher stitches a row of same-height images into a panorama - but only if they're related by pure horizontal translation. No rotation, no scale, no lens warp. That sounds limiting until you realize that a lot of real tiling is exactly that: you scanned or rendered a wide strip in overlapping slices with the camera sliding sideways. For that case, this node is faster and more predictable than the heavyweight OpenCV stitcher, because it refuses to do anything fancy.

The algorithm is a greedy canvas assembly. It starts with the first tile as the canvas, then each round estimates every remaining tile's horizontal offset against the current canvas - a coarse guess via matchTemplate on the middle band, refined with ECC (findTransformECC, translation-only motion). It picks the tile with the best correlation coefficient, and if that coefficient clears cc_threshold, it pastes it with a linear alpha blend over blend_width_px. If no tile clears the bar, it raises - that's your signal that the input isn't pure translation and you should reach for the CV2 stitcher instead.

Inputs:

  • images - IMAGE, a list, not a batched tensor. This node declares INPUT_IS_LIST, so you need to feed it a Python list of images - split that Load Images batch first or it'll throw a type error.
  • blend_width_px - INT (default 64), width of the feathered blend at each seam.
  • max_iter - INT (default 150), ECC refinement iterations.
  • eps_exponent - INT (default -6), ECC convergence epsilon exponent (smaller = tighter convergence).
  • cc_threshold - FLOAT (default 0.80), minimum correlation to accept a tile. If stitching keeps aborting, this is the first knob to lower.

Output: stitched - IMAGE, the assembled panorama.

Two behaviors worth knowing. It's height-strict: every input must share the same height, and offsets are horizontal only, so anything with vertical drift will score poorly on correlation and may stall the loop. And it's greedy - it pastes the best match each round and never reconsiders, so a bad early match can cascade. That's the price of a simple, fast, no-OpenCV-stitcher-pipeline node, and it's usually fine for clean tile rows.

Install is the pack standard:

cd ComfyUI/custom_nodes
git clone https://github.com/IDGallagher/ComfyUI-IG-Nodes
cd ComfyUI-IG-Nodes && pip install -r requirements.txt

Or ComfyUI Manager β†’ search "IG Interpolation Nodes" β†’ Install, restart. It does need opencv (the pack's opencv-contrib-python requirement) for the matching math. The README is :), but the whole greedy algorithm is spelled out in nodes/simple_translate_stitcher.py.

CategoryπŸ“ IG Nodes/IO

Inputs (5)

NameTypeDefaultDescription
imagesIMAGEβ€”
blend_width_pxINT640–2000β€”
max_iterINT1501–10000β€”
eps_exponentINT-6-10–-1β€”
cc_thresholdFLOAT0.800–1β€”

Outputs (1)

NameTypeDescription
stitchedIMAGEβ€”