Flow - Image Auto Batch
Merge the branches that survived into one batch
- image_1
- image
The bottom half of a Flow graph needs a way to collect the outputs of the branches that were left alive. FlowImageAutoBatch is that collector for images: you connect the end of each conditional branch, and it batches whatever images actually arrive into a single output. Closed branches contribute nothing, so what you get out is the union of the open paths.
It's the end-conditions counterpart to FlowImageCondition, which is where the branches split. And despite the name, it does real batch work - it concatenates images along the batch dimension, so it's not just "pick the first," it genuinely merges frames.
How it works
The inputs are dynamic: the frontend gives you image_1 and adds more image_N slots as you connect wires. At execution it walks its inputs, collects the non-None ones, and stacks them with torch.cat on the batch axis. If the images have different resolutions, it upscales the smaller ones to match the first image's dimensions (bilinear, center-cropped) so the batch stays rectangular - a very practical touch, since VAE Decode output from different branches rarely matches in size.
The flow system does the pruning for you: when a branch's gate is closed, the pack's validation deletes the nodes in that branch and removes that branch's input from this node. So at runtime, "whatever is connected" means "whatever branch is open."
If nothing is connected, it returns nothing - which in ComfyUI terms just means the node produces no output.
The inputs that matter
image_1(and theimage_Nslots you connect) - one per branch.
Output: image, the concatenated batch. Feed it to a save node or a batch-aware postprocessor.
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
Because the input slots are created dynamically by the UI, a workflow saved as JSON can lose the extra connections on reload - you may need to reconnect branches after loading a saved graph. Also, the batch concat means the output isn't a single chosen image; if you intended "pick branch A or B, one image," this gives you both when both gates are open (Multiple mode). The upscaling to the first image's size is automatic and bilinear, so mixing wildly different resolutions quietly degrades the smaller ones. For a strict one-of pick you'd use FlowConditioningAutoSwitch instead - that one returns the first connected value rather than concatenating.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_1opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |