Frames Slice
Trim a range of frames out of an image batch
- frames
- image
Where Frame Select grabs one frame, Frames Slice grabs a run of them. Give it a start and a stop, and it returns that contiguous chunk of an image batch - the ComfyUI equivalent of frames[start:stop]. In a video workflow that's how you trim: cut a clip down to the good ten frames, drop a bad tail, or split a long sequence into pieces you can process separately.
It lives in RES4LYF's images category because the pack does a lot of video work - Wan vid2vid, temporal conditioning, frame-by-frame prompting - and those graphs need a way to carve up frame stacks. This is the image-side tool for that; there's a latent-side twin (Frames Slice Latent) for when you're working before the VAE decode.
How it works
An IMAGE output is a batch of frames stacked in a tensor. This node slices that tensor between two indices and returns the sub-range as a new, smaller batch. It's a plain slice - no re-timing, no interpolation, just the frames that fall in the window.
The inputs that matter
- frames (
IMAGE) - the batch to slice, typically a decoded video sequence. - start (
INT, default 0) - the first frame to keep, zero-indexed. - stop (
INT, default 1) - where the slice ends. As with normal slicing, treatstopas the frame you count up to - set it to include the range you want and watch the output count to confirm.
The single output is image (IMAGE), the trimmed batch.
Installing it
ComfyUI Manager: search RES4LYF, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ClownsharkBatwing/RES4LYF/
cd RES4LYF
pip install -r requirements.txt
pip install in the venv or portable Python, restart, F5 to hard-refresh. No downloads.
Where people get tripped up
Off-by-one is the whole story here. If you're not sure whether stop is inclusive or exclusive, don't guess - run the batch through and count the frames that come out, then adjust by one if you're short or long. It costs you one preview and saves you a confusing render.
The other reliable mistake is a stop that exceeds the batch length, or a start past the end. That gives you an empty or truncated slice, which downstream shows up as "no frames" or a much shorter clip than expected. Know your batch length first - pull it from a size/count node - and keep both indices inside it. And if you only need a single frame, Frame Select is the cleaner tool; reach for Frames Slice when you want a span.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | — | |
| start | INT | 00–10000 | — |
| stop | INT | 11–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |