Nodes/Allor Plugin/ImageBatchFork
ComfyUI Node

ImageBatchFork

Split one batch into two — for dual-sampler setups

By Nourepide·Created 3 years ago·Updated 2 years ago· 295
ImageBatchFork
  • images
  • IMAGE
  • IMAGE
priority

ImageBatchFork splits an IMAGE batch down the middle and returns two IMAGE outputs: the first half and the second half. Inputs are images and a priority dropdown with two options - first or second. That's the whole interface, and the entire behavior is defined by one rule: when the batch has an even count, each output gets exactly half; when it's odd, the extra image goes to whichever side priority names.

So on a 10-image batch, output A gets images 1–5 and output B gets 6–10, regardless of priority. On a 9-image batch with priority set to first, A gets 5 and B gets 4; set to second, A gets 4 and B gets 5. There's also a nice special case: a single-image batch returns the same image on both outputs, which makes the node safe to drop into a pipeline that might only ever see one frame.

Why would you halve a batch? The killer use case is splitting between two samplers or two processing paths. Say you have a batch of frames and want to send half through an upscale path and half through a different pipeline - or run two sampler variants on the same generation so you can compare. One batch in, two branches out, and the two halves stay independent. It also reads naturally as a balanced split for A/B testing a node: same input, half the frames each way.

The two outputs are both IMAGE tensors, so each plugs straight into whatever downstream consumer you've got. Keep in mind the split is positional - "first half / second half" - not an even-odd interleave. If you want every other frame rather than a clean bisection, this isn't the node; you'd need a per-index selector.

Installing it

It ships with the Allor plugin:

cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt

Restart ComfyUI, or search "Allor" in ComfyUI Manager. Pack-level notes: requirements.txt drags in rembg and onnx for the segmentation nodes even though this node is pure tensor slicing, and Allor's repo was rebased to strip images from git history - a change that can break auto-updates, with troubleshooting pages in the docs at nourepide.github.io/ComfyUI-Allor-Doc.

Real talk

ImageBatchFork is the closest thing this pack has to a "router" for image batches, and it's genuinely handy in dual-branch workflows. The priority knob only matters for odd-sized batches, which surprises people - most of the time, any value works and you get a clean 50/50. The trap to avoid is expecting interleaved selection; this is a bisection, so if your two branches are meant to process alternating frames, you'll want a different tool. For halves, though, it just works.

Categoryimage/batch

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
priorityCOMBO2 options: first, second

Outputs (2)

NameTypeDescription
IMAGEIMAGE
IMAGEIMAGE