Image Batch Split (C2C)
Image Batch Split (C2C)
- images
- first_part
- remainder
- first_count
- remainder_count
Image Batch Split (C2C) splits one image batch into two at a single cut point - the frame-boundary twin of the pack's Image Batch Slice. Where Slice extracts a range and discards the rest, Split hands you both pieces: everything before the cut and everything from the cut on. That's the operation you reach for when you want to run different treatment on two halves of a video, or hold back the first N frames as a reference while processing the rest.
It's part of the C2C Helpers in ComfyUI-CustomNodePacks, the ~72-node umbrella pack from Code2Collapse (Likhith-24, active on r/comfyui).
How it works
Feed it images and pick how the cut is defined with the mode dropdown:
indexmode - cut at an absolute frame number.index=1(the default) puts the first frame alone infirst_partand everything else inremainder. This is the mode for "first frame = clean reference, rest = to be processed."ratiomode - cut at a fraction of the batch.ratio=0.5splits a 60-frame batch into two 30-frame halves;ratio=0.25takes the first quarter. Handy when you know you want "the first half" without counting frames.
The cut index is clamped to the batch size, so index=9999 on a 60-frame batch just puts everything in the first part rather than erroring. Outputs are first_part and remainder (both IMAGE), plus first_count and remainder_count (both INT) so you can wire the actual sizes downstream without trusting your mental math.
The inputs and outputs that matter
images- the only required input.mode-index(by frame number) orratio(by fraction). Decide which is more natural for your use.index/ratio- the cut position, used by the corresponding mode.first_part/remainder- the two output batches. Note the asymmetry:first_partis before the cut,remainderis the cut onward.first_count/remainder_count- frame counts for both, so a downstream node knows what it got.
Installing it
Ships inside ComfyUI-CustomNodePacks; no standalone repo. ComfyUI Manager → search "CustomNodePacks", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git
Pure tensor slicing, no extra dependencies or models. The pack overall needs opencv-python>=4.7.0 and scipy>=1.10.0 for its heavier nodes - install just those if missing (skip the full requirements.txt; it can clobber ComfyUI's torch). Restart ComfyUI.
Common issues
- The two halves don't add up to the original - they should, since it's a clean split, but if you're splitting a batch that a previous node already decimated, the count reflects the current batch. Check
first_count + remainder_countagainst what you think you fed in. - ratio=0.5 didn't land exactly in the middle - with an odd frame count it rounds to the nearest integer cut, so 61 frames → 31/30. Fine for most uses; if you need a precise frame, use
indexmode. - You need more than two pieces - chain two Splits, or reach for the pack's Image Batch Slice for an arbitrary range. Split is deliberately a binary operation.
The blunt take: it's a boring, correct utility. You won't think about it until the day you need "the first frame separate from the rest" and suddenly it's the exact node you were missing.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| mode | COMBO | index | 2 options: index, ratio |
| index | INT | 10–100000 | — |
| ratio | FLOAT | 0.500–1 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| first_part | IMAGE | — |
| remainder | IMAGE | — |
| first_count | INT | — |
| remainder_count | INT | — |