Nodes/ComfyUI-Logic/📦 Batch Combiner
ComfyUI Node

📦 Batch Combiner

Turn a pile of images (or audio, or latents) into one batch

By playboy-dongan·Created 6 months ago·Updated 6 months ago· 0
📦 Batch Combiner
  • any1
  • any2
  • any3
  • any4
  • any5
  • any6
  • any7
  • any8
  • any9
  • any10
  • batch

ComfyUI's batching is great until it isn't. Sometimes you end up with three separate IMAGE outputs that you know should be one batch - because the downstream node wants a single tensor, not three wires. The 📦 Batch Combiner exists exactly for that: it takes up to ten any inputs (dynamic ports, same connect-and-it-grows behavior as the Switcher) and merges them into one value on the batch output.

The reason this is genuinely useful rather than a toy is that it knows what it's combining. The node dispatches on the type of the first input:

  • IMAGE and MASK - concatenated on the batch dimension. This is the star case: images of different sizes get zero-padded to the largest dimensions and stacked, so instead of a shape-mismatch error you get a batch where the smaller frames are letterboxed with black. You'll want to resize first if padding isn't what you wanted, but the node won't crash on you.
  • LATENT - the samples tensors get concatenated, and the batch_index is renumbered so the batch stays coherent downstream.
  • AUDIO - waveforms are stitched end-to-end into one continuous clip, resampled to the first clip's sample rate and channel-aligned so stereo/mono segments don't explode. This is the "concatenate two audio files into one track" move that's otherwise shockingly hard in ComfyUI.
  • LIST - merged sequentially into one longer list.

The mechanism, in case you care: everything funnels through a pad-and-cat helper that works on tensors, and the audio path either uses torchaudio for resampling or falls back to a linear interpolation if you don't have it. torchaudio isn't in the pack's dependency list, so on a minimal install you may get the fallback - same result, slightly different quality for big rate changes.

The header is the underrated feature: after running, it shows the result type and a detail line - for audio that's the combined duration and sample rate (AUDIO 6.28s 44100Hz), for images/latents the batch count. That "what did this actually produce" readout catches wrong-type mistakes instantly.

A few honest gotchas. First, if you feed it zero connected inputs it emits an ExecutionBlocker - nothing flows, and downstream goes dark silently. Second, a single input is passed through untouched, which is convenient but means "I thought I'd combined two images" with only one wired is a silent no-op. Third, mixed types behave by first-input dispatch: if the first input is an IMAGE and the second is a LIST, you'll get the image branch, and the list gets coerced through tensor concatenation or dropped depending on shape. Keep your inputs type-homogeneous per combiner; that's the design, and it's a reasonable one.

When would you reach for it? Video pipelines (Decompose gives you frames, you split them, process branches, then want them back as one batch), multi-CLIP prompt assembly, stitching audio takes, or the classic "I have three saved images and I want to view them as one grid" move. It's the natural complement to the pack's Decompose Video node: split it apart, work on the pieces, recombine.

Install is the standard pack flow:

cd ComfyUI/custom_nodes
git clone https://github.com/playboy-dongan/ComfyUI-Logic-nodes

or ComfyUI Manager → "ComfyUI-Logic-nodes" → restart. No model downloads. It's an output node that always runs (IS_CHANGED → NaN), so it'll also force its upstream chain to execute each run - cheap for a combiner, just know it's there.

If "merge these into one" has ever been the step that stopped your workflow cold, this is the node you were missing.

Category⚡ Logic

Inputs (10)

NameTypeDefaultDescription
any1opt*
any2opt*
any3opt*
any4opt*
any5opt*
any6opt*
any7opt*
any8opt*
any9opt*
any10opt*

Outputs (1)

NameTypeDescription
batch*