Image Batch Multi V2
Stack image batches without the black-frame tax
- image_1
- image_2
- images
Image Batch Multi V2 is a fix for one of the quietest annoyances in ComfyUI: merging several image inputs into a single batch when some of those inputs are empty. The classic KJNodes ImageBatchMulti does this by filling unconnected slots with black placeholder frames - which works mechanically and pollutes your batch silently. Feed that batch into a video model, an AnimateDiff pass, or a batch upscaler and suddenly you have one garbage black frame baked into every run. This node does the same job but simply skips missing or bypassed inputs instead of padding with black. No inputs connected at all? It returns no image output rather than a batch of nothing but placeholders.
It's a deliberate copy of KJNodes' node from the ComfyUI-FeiHou-Toolbox pack - same dynamic input-count workflow, different missing-input policy. If you've ever been bitten by a stray black frame in a batch, you already know why this variant exists.
How it works
The dynamic input list is the KJNodes signature: set inputcount (default 2, up to 1000) and hit the Update inputs button to add or remove image_N sockets. The backend then walks every connected input, keeps only the ones that are real image tensors (4D, with at least one frame), and concatenates them along the batch dimension - the output batch size is the sum of the connected frames, not the number of sockets.
Two behaviors worth knowing because they're silent:
- Mixed resolutions get resized. Everything is resized (bilinear) to match the first connected image's width and height. A 512×512 and a 1024×1024 in the same batch means one of them is getting upscaled or downscaled behind your back.
- Mixed channel counts get padded. If one input has an alpha channel and another doesn't, the smaller ones are padded up to the max channel count. Fine when you intended it, surprising when you didn't.
Inputs and output
inputcount- the number of image sockets to expose. Change it, click Update inputs.image_1,image_2, ...image_N- optional IMAGE inputs. Missing or bypassed ones are skipped, not black-filled.images- the concatenated batch (IMAGE).
Install
ComfyUI Manager (search ComfyUI-FeiHou-Toolbox), or:
cd ComfyUI/custom_nodes
git clone https://github.com/FX-FeiHou/ComfyUI-FeiHou-Toolbox
Restart ComfyUI and hard-refresh the browser. No extra Python dependencies; the pack is written against ComfyUI's newer comfy_api.latest node API, so keep ComfyUI current. The Update inputs button is a JS widget - a stale browser page means the dynamic sockets won't behave, so refresh if sockets aren't appearing.
Gotchas
- Output jumps around when a source is bypassed - that's the feature, not a bug: frames from the active inputs just get closer together instead of a black frame appearing.
- Unexpected resizing - all inputs are normalized to the first image's dimensions. If your sources differ in resolution, standardize them upstream (or order the inputs so the target resolution is
image_1). - Nothing out when nothing in - a fully unconnected node returns no image output. If something downstream is failing, check you actually connected a live input; the node won't save you with an empty batch.
Where this shines: multi-source character or scene pipelines where you keep one input bypassed while testing, and you don't want your test frames padded with black. That's the exact case the original node was a minefield for.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| inputcount | INT | 22–1000 | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |