Nodes/comfyui-OreX/🧵 Image Chunk Stich (OreX)
ComfyUI Node

🧵 Image Chunk Stich (OreX)

Sew your processed chunks back into one clip

By orex2121·Created about a year ago·Updated about 18 hours ago· 34
🧵 Image Chunk Stich (OreX)
  • image_chunks
  • image
  • frame_count
trim_first0
trim_end0

The back half of the OreX chunking pair. Where Image Chunk Cut slices a long frame sequence into fixed-length pieces, Image Chunk Stich takes those pieces back and concatenates them into a single tensor - and it knows how to trim, which matters because Cut pads its final chunk with mirrored frames. Sew the chunks, trim the padding, and you have your processed video back in one piece.

How it works

It accepts a list of IMAGE chunks (INPUT_IS_LIST = True on the input) and does a plain torch.cat along the frame dimension, preserving order. Then it applies two trim values:

  • trim_first - frames to drop from the head.
  • trim_end - frames to drop from the tail.

Those are exactly what you use to undo Cut's reversed-frame padding: if Cut padded shortfall frames onto the end, you set trim_end to that number (you can feed it straight from Cut's shortfall output) and the stitched result matches your original sequence length. Outputs are image (the stitched tensor) and frame_count (its length), so the rest of your graph knows what it's dealing with.

Two safety behaviors worth knowing: if it receives no chunks it returns a zero-frame result rather than crashing, and if your trim values would cut everything, it returns a single frame instead of an empty tensor. Neither is elegant - they're just failure modes that don't take down the whole queue.

Where it fits

The pairing is obvious: Cut → (process chunks) → Stich. You can also use Stich standalone to merge any list of frame sequences, since the trim values make it a general concatenator with edge-trimming. Wire the shortfall from Cut into trim_end and the loop is closed.

Install

ComfyUI Manager (search "comfyui-OreX") or:

cd ComfyUI/custom_nodes
git clone https://github.com/orex2121/comfyui-OreX

Restart. No extra dependencies - this is a concat plus a slice.

The honest caveat

Same limitation as its sibling: stitching doesn't fix temporal consistency. If each chunk was processed independently, the boundaries will show it - color shifts, motion jumps, subject drift - because no chunk saw the context around it. Stich faithfully reassembles what you gave it; it can't smooth the seams. For that you want chunk-aware processing (like the pack's Scail2, which carries overlap between chunks and color-corrects the boundaries). If your chunks are independent renders that don't need to match, this node is perfectly adequate and dead simple.

CategoryOreX/Image

Inputs (3)

NameTypeDefaultDescription
image_chunksIMAGE
trim_firstINT00–100000
trim_endINT00–100000

Outputs (2)

NameTypeDescription
imageIMAGE
frame_countINT