Nodes/IG Interpolation Nodes/🧩 IG Stitch Depth Tiles
ComfyUI Node

🧩 IG Stitch Depth Tiles

Reassemble sliced depth maps into one seamless image β€” even cylindrical ones

By IDGallagherΒ·Created 3 years agoΒ·Updated about a year agoΒ· 3
🧩 IG Stitch Depth Tiles
  • depth_tiles
  • depth
β—„tile_width512β–Ί
β—„overlap_width64β–Ί
β—„image_widthβ€”β–Ί
β—„batch_size1β–Ί
β—„wrap_horizontalfalseβ–Ί

IG Stitch Depth Tiles is the inverse of a tiling node: it takes depth-map tiles that were sliced horizontally with a fixed overlap and reassembles them into a single full-width depth image. If you tiled a wide depth map because it wouldn't fit in one pass, or you generated a cylindrical panorama one slice at a time, this is the node that puts it back together - with feathered seams instead of hard edges.

The stitching is a weighted overlap blend, not a naive paste. Each tile gets a 1D linear ramp over its overlap regions (fade in on the left, fade out on the right), tiles are placed at stride = tile_width - overlap_width intervals, and the final image is the sum of tile Γ— weight divided by the accumulated weight. Where tiles overlap, the two ramps cross and cancel each other's seams. The wrap_horizontal flag is the special sauce: with it on, the first and last tiles blend into each other across the seam, so pixel 0 matches pixel W - 1 - a seamless cylindrical depth map, ready for the cylindrical pointcloud projection in this same pack.

Inputs:

  • depth_tiles - IMAGE, the tile batch ([B Γ— n_tiles, H, tile_width, C]).
  • tile_width - INT, width of each tile in pixels (default 512).
  • overlap_width - INT, the overlap used when tiling (default 64).
  • image_width - INT, the original full width - your target canvas.
  • batch_size - INT, how many original images the tiles came from (default 1), so one tile-batch can stitch several maps at once.
  • wrap_horizontal - BOOLEAN (default False), cylindrical wrap mode.

Output: depth - IMAGE, the stitched [B, H, image_width, C] map(s).

The geometry needs to be right or the seams show. The image_width must match tile_width plus the overlaps you actually used - the node computes n_tiles from the batch dimension and stride from tile/overlap widths, and if those don't agree with image_width you'll get either gaps (too small) or a last tile that's clamped into place (too big). When wrap_horizontal is on, a tile that runs past the right edge wraps around and blends onto the left, so the final wrapped tile can legally overlap more than its neighbors. Batch size must divide the tile count evenly, or it raises.

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. The pack's own IG Tile Image (same repo) produces the slice format this expects, so if you're tiling for depth, use the pair together. The README is :), but the ramp-blend math lives in nodes/stitch_depth.py.

CategoryπŸ“ IG Nodes/IO

Inputs (6)

NameTypeDefaultDescription
depth_tilesIMAGEβ€”
tile_widthINT512β€”
overlap_widthINT64β€”
image_widthINTβ€”
batch_sizeINT1β€”
wrap_horizontalBOOLEANfalseβ€”

Outputs (1)

NameTypeDescription
depthIMAGEβ€”