π Trim Batch Ends
Chop frames off either end of a clip without leaving the graph
- clip_frames
- images
Every video workflow eventually needs to cut frames off the start or end of a clip - a generator that added two warm-up frames at the front, a few trailing frames you don't want, an intro you'd rather drop. You could do this by fiddling with index and slice nodes, or you could reach for Trim Batch Ends, which is just two numbers: how many frames to remove from the start, how many from the end. It always keeps at least one frame, so you can't accidentally trim yourself into an empty tensor.
It sounds too simple to be worth an article, and honestly it mostly is - which is fine. It's a utility node, the kind you drop in when you want the graph to read clearly instead of hiding a slice behind three other nodes. WhiteRabbit ships a handful of these one-job nodes (Roll Frames, Unroll Frames) and they all follow the same philosophy: make the batch manipulation explicit and obvious.
How it works
It slices your IMAGE batch from both ends and returns what's left. There's no cleverness to it, which is the feature. trim_start_frames drops frames from the front, trim_end_frames drops from the back, and the node clamps so at least one frame survives even if you ask it to trim everything.
The inputs that matter
- clip_frames - your clip (framesΓHΓWΓC, 0β1).
- trim_start_frames - frames to remove from the start.
- trim_end_frames - frames to remove from the end.
- images (output) - the trimmed clip.
Installing it
It's part of the WhiteRabbit pack, so you get it with the one-time install:
cd ComfyUI/custom_nodes
git clone https://github.com/Artificial-Sweetener/comfyui-WhiteRabbit
cd comfyui-WhiteRabbit
python -m pip install -r requirements.txt
or ComfyUI Manager β "WhiteRabbit" β install β restart. The pack targets ComfyUI's v3 node API; its only pip dependency is torchlanc.
Where people get burned
- Trimming before you know the length. If you trim more frames than the clip has, the node clamps to one frame rather than erroring - so a miscalculated trim silently gives you a single-frame "clip" instead of telling you something's off. Check your clip length first if the output suddenly looks wrong.
- Using it as a general-purpose cut tool. This only trims from the ends. For cutting a middle section out, you want a batch-slicing approach with index nodes - trimming from both ends can't reach the middle.
Use it right before your seam-prep or interpolation step to clean up a clip's edges, and you'll stop thinking about it within a day - which is exactly what a utility node should do.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| clip_frames | IMAGE | Your clip (framesΓHΓWΓC, 0β1). | |
| trim_start_frames | INT | 00β100000 | Frames to remove from the START. |
| trim_end_frames | INT | 00β100000 | Frames to remove from the END. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | β |