Any Batch Group
ComfyUI's AnyBatchGroup, Explained
- any_1
- any_2
- batch
Two inputs, one output, and the node has no idea what it's holding. That's AnyBatchGroup in a nutshell: the "make one thing out of two" node from the Zar4X/ComfyUI-Batch-Process pack. No knobs, no settings, no type picker - you plug in two of whatever and get one thing back, batched. It's the kind of node you don't think about until you're staring at a graph that needs it, and then it's the only node that fits.
Here's the problem it solves. ComfyUI is famously strict about types: two images from two different loaders won't merge with one node, two latents won't, two lists won't, and two 3D meshes really won't. So when your workflow has two sources that need to become one batch - a second folder of references, a second latent, an extra model you generated - you used to either restructure the whole graph or install a dedicated concat node per type. AnyBatchGroup replaces all of them.
How it works
Under the hood it's a type-dispatch node. Feed it images and it converts everything to BHWC, center-pads the smaller ones up to the largest with black borders, and concatenates along the batch dimension. Feed it latents and it concatenates the samples - and if the two latents are different resolutions, it bilinearly upscales the smaller one to match before joining. Feed it meshes and it merges them into a single MESH batch using ComfyUI's native 3D helpers. Strings or numbers get gathered into a list. Anything list-like just gets added (a + b).
That's the whole mechanism, and it's why this is a genuinely useful node rather than a trap: it's a concat, not a magic type-eraser. The * input type accepts anything, but both sides actually have to be the same kind of thing, and it will tell you when they're not with a clean error - "Channel mismatch" for an RGB image against an RGBA one, "cannot mix MESH and File3D" for mixed 3D input. Given the community's long-running fight about Anything Anywhere-style nodes that hide what's actually flowing through a wire, this is the safe version of that magic: it merges, it doesn't hide.
The inputs and outputs that matter
There are exactly two inputs and one output. That's the entire node:
any_1,any_2- the two things you're merging. Both accept any type.batch- the merged result, same type as whatever you put in. Wire it into anything that takes a batch of that kind of data: a sampler, a preview, a batch saver.
The 3D Model Batch Saver in the same pack actually names AnyBatchGroup as its natural feeding source, which tells you the intended shape of the workflow: generate a few models, group them into one batch, save the whole batch in one pass. If you need to merge more than two things, chain them - AnyBatchGroup(AnyBatchGroup(a, b), c).
Installing it
This node ships with the ComfyUI-Batch-Process pack, so the install is the whole pack:
- ComfyUI Manager: search for "ComfyUI-Batch-Process" and install.
- Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Zar4X/ComfyUI-Batch-Process
Then restart ComfyUI. The pack's requirements.txt is just Pillow and torch - both already part of any working ComfyUI - and there are no model files to download. The one thing to know: the GitHub README still only documents the pack's loader/saver nodes, so don't go looking for this one there. It's registered and working; the README just lags the code.
Common issues
Most failures here are type mismatches, and the error messages are actually helpful once you know what they mean:
- "Channel mismatch" - you're merging a 3-channel RGB image with a 4-channel RGBA. Fix the source (or an alpha-convert node) upstream.
- "cannot mix MESH and File3D" - one side is a loaded file reference, the other is a generated mesh. Convert to one type first.
- Different-sized images get padded, not resized. The small one gets centered on black. If those bars will poison something downstream, resize to a common size before you merge.
It's a small node, but it's the kind of small node that removes a whole class of "why won't these two connect" pain. If you batch anything in ComfyUI, this earns its place.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| any_1 | * | — | |
| any_2 | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| batch | * | — |