My Split Image Batch
Slice an image batch like a Python list, without the Python
- images
- IMAGES
- frame_count
Once your video becomes an IMAGE batch, the next question is almost always "but I don't want all of it." My Split Image Batch is the answer: it's a fancy way to write batch[start:start+length] in the node graph. You tell it where to start, how many frames you want, and optionally how to stride through them. It's a slice operation with a UI, and once you think of it that way, it stops being mysterious.
You'll reach for it constantly once it's in your workflow. Loaded a 500-frame clip but only want frames 50–150 for a test pass? This node. Want to strip the first 30 frames of a video you're using as AnimateDiff conditioning? This node. It's the trimming workhorse of the pack, sitting between a video loader and the rest of your graph.
How it works
Under the hood it's plain tensor slicing on the batch dimension. The whole thing is a few lines:
end_index = min(start_index + length, total_frames)
selected_images = images[start_index:end_index]
The select_every_nth twist is the part worth understanding, because it changes what length means. When you set it to 2, the node builds a range like range(start, start + length * nth, nth) - so length becomes how many frames you get out, and the node reaches length × nth frames deep into the batch to grab them. Set start=0, length=50, every_nth=2 and you get 50 frames sampled from the first 100. It's a frame-rate reducer, not a window that happens to skip.
The inputs and outputs that matter
Four inputs, three of which you'll actually touch:
- images - any IMAGE batch: the output of a video loader, a batch of generated frames, whatever.
- start_index (default 0) - zero-based frame to start at.
- length (default 100) - frames to pull. If the batch is shorter, it just takes what's there.
- select_every_nth (default 1) - the optional one. Leave it at 1 for a plain contiguous slice; raise it to sample every Nth frame.
IMAGES comes out as a new batch, ready to feed a VAEEncode, a sampler, or Video Combine. frame_count tells you exactly how many frames you got - wire it to a text or counter node and you can verify your math without guessing.
Installing it
It ships in the same pack as the rest of the My Load Video family, so the install is identical - clone the repo or use ComfyUI Manager:
cd ComfyUI/custom_nodes
git clone https://github.com/1123156819/comfyui-myloadvideo.git
Restart ComfyUI and the three nodes all appear under image/video. No models, no extra dependencies beyond what ComfyUI already has.
Where people get burned
Start + length overshooting the end. The slice clamps to the batch, so you just get fewer frames than asked - no crash. But if start alone is past the end, the result is empty and the node raises ValueError, which shows up as a red node. Check frame_count on the loader to know what you're slicing.
The select_every_nth trap. Remember length counts output frames when sampling is on. Set length=100 on a 100-frame batch with every_nth=2 and you'll be told there's nothing left to take. If you want to preview a whole clip at half rate, length should be about half the batch, not the whole thing.
Sampling before or after generation. There's a real fork in the road: sample the input frames to make a vid2vid pass faster and cheaper, or run the full pass and sample the output before Video Combine. Both are legit; they just answer different questions. Sampling input is a speed trick; sampling output is a final edit.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| start_index | INT | 00–999999 | — |
| length | INT | 1001–999999 | — |
| select_every_nthopt | INT | 11–999 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGES | IMAGE | — |
| frame_count | INT | — |