Flow - Latent Auto Batch
The latent twin of FlowImageAutoBatch
- latent_1
- latent
If you want to branch your graph before the VAE - while everything is still latents - this is the node that joins the surviving branches back together. FlowLatentAutoBatch is the latent counterpart of FlowImageAutoBatch: a dynamic-input collector that concatenates the latents from whichever conditional branches are open into a single batch, batch metadata included.
Pair it with FlowLatentCondition, which is the splitter on the other side. Image-space batching loses you the ability to sample the merged result; latent-space batching keeps everything inside the diffusion loop until you're ready to decode.
How it works
Same shape as FlowImageAutoBatch: inputs are dynamic (latent_1 plus more latent_N slots as you connect), and it walks them, keeping the non-None ones. It concatenates their samples tensors on the batch axis and - the part the image version can't do - merges the batch_index lists that ComfyUI attaches to latents, so the output latent knows which batch slots belong to which source. That's what lets a downstream KSampler treat the merged batch coherently instead of confusing the batch indices.
If the latents have different spatial sizes, the smaller ones are upscaled to match the first (bilinear) so the concat works. This is exactly the code stock ComfyUI's LatentBatch does, extended to N inputs and hooked into the flow system.
As with the other auto nodes, the flow validation deletes the inputs fed by closed branches before execution, so only open branches actually contribute.
The inputs that matter
latent_1(and thelatent_Nslots you connect) - one per branch, typically the output of FlowLatentCondition.
Output: latent, the merged batch, ready for FlowKSampler or a VAE decode.
Install
Part of ComfyUI-Flow-Control:
cd ComfyUI/custom_nodes
git clone https://github.com/krich-cto/ComfyUI-Flow-Control
Restart ComfyUI, or Manager → "ComfyUI-Flow-Control".
Gotchas
The dynamic inputs mean saved workflow JSONs can lose extra connections on reload - reconnect after loading. Batch indices matter: if you concatenate latents that came from different samplers with different noise, the merged batch can carry that inconsistency downstream; it's fine for same-model branches, less so for mixing models. And the bilinear upscale of mismatched latents happens silently, so wildly different resolutions get quietly smushed to the first branch's size. If you only ever have one branch, you don't need this node at all.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| latent_1opt | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |