ComfyUI Node

CS Concat Images

Glue your chunked video batches back together

By lvqunx·Created about a month ago·Updated about a month ago· 0
CS Concat Images
  • image1
  • image2
  • image3
  • image4
  • IMAGE

Somewhere in every video workflow there's a node that wants one batch of frames and your graph has four. CS Concat Images is the reconciliation: it takes up to four IMAGE batches and stacks them along the frame dimension into a single batch. That's the entire node, and it's genuinely useful - most often because you decoded the video in chunks.

It comes from CS Hybrid 4K Image-to-Video (lvqunx/comfyui-cs-hybrid), a small new pack built around running video diffusion at low resolution and stitching 4K detail back in afterward. The pack's whole personality is "do everything small so VRAM stays low," and chunked VAE decode is exactly that: decode 16 frames at a time instead of 121, then rejoin. This node is the rejoin.

How it works

It's a torch.cat along dimension 0 - the batch dimension. Concatenation, not blending. If image1 is 30 frames and image2 is 40, you get 70 frames in one tensor, in the order you plugged them in. That ordering is the one thing that matters: in video, frame order is the content, so connect the chunks in the sequence you want them played back.

The inputs that matter

  • image1 - required, your first chunk.
  • image2, image3, image4 - optional. Leave one unwired and it's simply skipped; the node needs only what you give it.

The single IMAGE output is the merged batch, ready for whatever wants the full clip - the pack's flow estimator, a refiner, a video saver.

The two traps

First, all the inputs must share the same resolution, channel count, and dtype. This is a strict tensor concat, not a resize-and-stitch. If your chunks came from a VAE that was run at slightly different sizes (a mid-batch upscale, a crop that changed the height), the node throws a tensor shape error. That's actually the good kind of failure - loud and immediate.

Second, order. This node cannot fix a chunk that arrived out of sequence. Label your decode chunks or keep them in a tight row on the canvas, because an out-of-order concat produces a video that plays wrong with zero complaints.

Install

Same pack, same story:

cd ComfyUI/custom_nodes
git clone https://github.com/lvqunx/comfyui-cs-hybrid
# restart ComfyUI

Or ComfyUI Manager → search CS Hybrid 4K Image-to-Video. Zero extra dependencies; torch and torchvision already live inside ComfyUI. If you're here for the whole 4K i2v pipeline, note that concat is the glue step - decode chunks in, one frame batch out, then hand it to CS Flow Estimate.

Common issues

Beyond the shape error and the ordering trap, there's the "why is my batch suddenly half the frames" confusion - that's usually a chunk that got dropped upstream (a bypassed decode, a sampler that didn't produce its share) rather than this node misbehaving. Count your frames in the preview before and after and you'll find the culprit in thirty seconds.

CategoryCSHybrid

Inputs (4)

NameTypeDefaultDescription
image1IMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE