ComfyUI Node

PVL Batch Any

Images, latents, numbers, lists

By pvlprk·Created about a year ago·Updated 8 months ago· 1
PVL Batch Any
  • any_1
  • any_2
  • batch

ComfyUI has plenty of batching nodes, but they're picky about types. PVL Batch Any is the grab-bag answer: two wildcard inputs, one output, and it figures out how to concatenate whatever you hand it - image tensors, latent dicts, numbers, lists, tuples. It comes from the pvlprk/comfyui-pvl-api-nodes pack, it's fully local, and its only job is "join two things into a batch."

When does that actually help? You have two batches of images from different branches and want to feed them to one sampler or one save node. You have a pair of latent sets you want sampled together. Or you're assembling a list of strings/numbers across a conditional split and want them merged back into one sequence. The "any" in the name is doing real work - most batch nodes can't accept all of those.

How it works

any_1 and any_2 are * (wildcard) inputs, so ComfyUI lets you wire almost anything. The node then dispatches on type:

  • Tensors (images, etc.): concatenates along the batch dimension. If the spatial shapes don't match, it upscales the second to the first's resolution with bilinear sampling first - so a 512px batch and a 768px batch can still be joined (at a cost).
  • Latent dicts: joins the samples along batch, upscaling spatial dims if needed, and merges the batch_index bookkeeping so downstream nodes stay sane.
  • Primitives and sequences: numbers/strings get folded into a list or appended to an existing list/tuple.
  • Fallback: plain Python + concatenation.

If either input is None it passes the other through, so partially-wired chains don't crash.

Inputs and outputs

  • any_1 and any_2 (both required wildcard sockets).
  • Output: batch (wildcard). Whatever type came in is what comes out - a batch of images stays an IMAGE, a batch of strings stays a STRING list.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes

Restart ComfyUI. No key, no network, none of the cloud-node dependencies needed.

Where people get burned

  • Silent upscaling can bite. When the two inputs differ in resolution, it resizes the second to match - which is usually what you want for a coherent batch, but it's a hidden resize, and downscaling loses detail. If you need pixel-exact batches, normalize sizes upstream.
  • It only takes two inputs at a time. To batch five images you chain it (pair, then pair the result with the next). Fine, but plan the graph.
  • Wildcard sockets sometimes accept things that surprise you. The fallback + path can throw on two dicts that aren't latent-shaped - read the error, don't assume the node is broken.
CategoryEasyUse/Logic

Inputs (2)

NameTypeDefaultDescription
any_1*
any_2*

Outputs (1)

NameTypeDescription
batch*