Nodes/smn_support_nodes/[SSN] Prep Append Batch
ComfyUI Node

[SSN] Prep Append Batch

Stitch two image batches into one, when they're the same size

By SummonTheCat·Created about a year ago·Updated about a year ago· 0
[SSN] Prep Append Batch
  • images_a
  • images_b
  • IMAGE

[SSN] Prep Append Batch takes two image batches, images_a and images_b, and concatenates them into one batch along the frame axis. A batch of ten frames and a batch of five frames become one batch of fifteen, in order - first A's frames, then B's. That's the whole job, and it's a genuinely useful one.

You hit the need for this the moment a workflow generates video in chunks. AnimateDiff and video pipelines routinely produce batches in segments - a 60-frame clip generated as three 20-frame passes, or a series of shots each from its own branch that need to become one contiguous sequence before encoding. ComfyUI's Save/Preview nodes and this pack's own SsnOutputWebM encode whatever batch you hand them, so combining segments before the output node is exactly where Append Batch earns its keep. It's also handy when a single image (a batch of one) needs to be glued onto the start or end of a longer clip.

Mechanically it's one line: torch.cat along dimension zero, after checking that the two inputs match in height, width, and channels. That check is the contract, and the error message is refreshingly clear: "Image batches must have the same dimensions except for the batch size." If you're getting that error, your two batches genuinely have different resolutions or channel counts, and no amount of rerunning will fix it - normalize first with SsnPrepCrop (canvas) and SsnPrepFlattenAlpha (channels), then append.

The honest limitations: it's a strict concatenation, not a blend, not a crossfade, not a re-timing. If you want frames to overlap or fade between segments, this isn't the node - but as a plain "join these two sequences" it's exactly right, and it works regardless of how the two batches were generated as long as the shapes line up.

Install

Part of smn_support_nodes by SummonTheCat. ComfyUI Manager → search smn_support_nodes → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/SummonTheCat/smn_support_nodes

Restart required. Dependencies (opencv-python, imageio-ffmpeg) auto-install; no models to download.

Troubleshooting

The only real failure is the dimension mismatch, and it tells you exactly that. If both inputs look like they should match, the usual culprit is a channel difference - one branch flattened to RGB and the other still RGBA. Also note the output inherits whatever channel count the inputs share, so if both are RGBA, the result is RGBA, and downstream RGB-only nodes will complain; flatten first if that's your end goal.

Categorysmn/prep

Inputs (2)

NameTypeDefaultDescription
images_aIMAGE—
images_bIMAGE—

Outputs (1)

NameTypeDescription
IMAGEIMAGE—