Split Images π₯π ₯π π ’
Cut a frame batch into two groups at an index
- images
- IMAGE_A
- A_count
- IMAGE_B
- B_count
Split Images does one simple thing: it cuts an image batch into two at a point you choose. The first chunk of frames goes out one output, the rest go out another. It's the counterpart to Merge Images in Kosinkadink's VideoHelperSuite, and the two together let you branch a video into segments, process them differently, and stitch them back - the classic use being "treat the first half of this clip one way and the second half another."
On its own it's not glamorous, but batch surgery is a real need in video graphs. Isolate a run of frames to re-render, peel off an intro, or separate a sequence so two different ControlNets each handle a portion. Split here, do the work, Merge Images back.
How it works
You set a split_index, and the node sends the frames before that index to output A and everything from that index onward to output B. It's forgiving about edge cases: if the batch is shorter than split_index, all the frames land in A and B comes out empty rather than erroring.
The inputs and outputs that matter
images- the batch to split.split_index- where the cut happens. The firstsplit_indexframes go to A; the frame at that index starts B.
Four outputs:
- IMAGE_A - the first group.
- A_count - how many frames ended up in A (equals
split_indexunless the input was shorter). - IMAGE_B - the second group.
- B_count - the size of B.
The counts are there so downstream nodes can react to variable split sizes without you hard-coding numbers.
How to install it
ComfyUI Manager: search ComfyUI-VideoHelperSuite, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
then restart. No model downloads.
Common issues & troubleshooting
Output B is empty. Your split_index is at or beyond the batch length, so everything went to A. That's the documented behavior, not a bug - lower the index or check that your input actually has as many frames as you think (wire it through a count).
Off-by-one on the boundary. The split is exclusive on A's side: split_index frames go to A (indexes 0 to split_indexβ1), and B starts at split_index. If you want frame 10 to be the first frame of B, set the index to 10.
Recombining changed the order. Merge Images concatenates A then B, so feed them back in the same order you split them to preserve the sequence. Swap the inputs and you reverse the halves.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| split_index | INT | 0-9007199254740991β9007199254740991 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE_A | IMAGE | β |
| A_count | INT | β |
| IMAGE_B | IMAGE | β |
| B_count | INT | β |