Nodes/Praveen's ComfyUI Tools/Split Image List (3-Way)
ComfyUI Node

Split Image List (3-Way)

Cut one batch into thirds and give each third its own destiny

By Praveenhalder·Created about a year ago·Updated 6 months ago· 2
Split Image List (3-Way)
  • images
  • images_1
  • images_2
  • images_3
split_ratio_10.33
split_ratio_20.33

Split Image List (3-Way) takes one IMAGE batch and slices it into three batches, sized by two ratios you control. It's a routing node: instead of running every frame through the same pipeline, you split, send each third down a different path, and recombine later. The classic use is A/B/C testing - same batch, three different prompts or samplers, compare the thirds.

This is the complement to the pack's Merge Image Lists (3-Way), which concatenates three batches back together in a configurable order (1-2-3, 2-1-3, and the rest). Split, process each third differently, merge in whatever order you like - that loop is the whole feature.

Inputs and outputs

  • images (IMAGE) - the batch.
  • split_ratio_1 (FLOAT, 0–1, default 0.33) - size of the first slice, as a fraction of the batch.
  • split_ratio_2 (FLOAT, 0–1, default 0.33) - size of the second slice, as a fraction of what remains after the first cut, not of the whole batch. Worth knowing before you set ratios expecting intuitive math.

Outputs are images_1, images_2, images_3 - three IMAGE batches.

How it works

The code computes split1 = round(total * ratio_1), then splits the remainder at round(remaining * (ratio_2 / (1 - ratio_1))), which normalizes the second ratio against the leftover. The defaults land at 0.33/0.33/0.34 on a large batch. On small batches the rounding gets chunky, and the code clamps so each slice gets at least one frame - so a batch of 5 doesn't give you clean thirds, it gives you something defensible. Keep batches at 6+ frames if you actually want thirds.

The trap to avoid

The output type is IMAGE, not a Python list - each output is a contiguous slice of the batch tensor, not a collection you can index. That's ComfyUI normal, but if you came from a node pack where "list" means an actual list, it's an easy mental slip. Also: the inputs to the merger must be wired in matching order, or your "split → route → merge" flow reorders the frames silently. With per-frame consistency on video that's a subtle bug, so label your wires.

Installation

Part of Praveen's ComfyUI Tools. Install via ComfyUI Manager (search "Praveen" / "praveen-tools"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Praveenhalder/praveen-tools

Restart ComfyUI. No dependencies beyond stock ComfyUI (PyTorch, PIL, NumPy), no model downloads. For A/B/C testing on a batch, this pair is the simplest thing that does the job.

Categoryimage/list

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
split_ratio_1optFLOAT0.330–1
split_ratio_2optFLOAT0.330–1

Outputs (3)

NameTypeDescription
images_1IMAGE
images_2IMAGE
images_3IMAGE