〽️ Image Ops Frame Range
Trim, hold, loop, and reverse frame batches — the timeline editor in node form
- image
- image
- frame_count
ImageOps FrameRange is the node that does the boring, essential work of video editing inside a ComfyUI graph: trimming a batch of frames down, holding one frame, looping a range, bouncing it back and forth, reversing it, or repeating it a set number of times. It's from the ComfyUI-Majoor-ImageOps pack, and it exists because once you're generating animation or video with ComfyUI, half your time is spent wrangling frame counts - not generating.
The controls
Everything here is about selecting and repeating a range of frames:
trim_start/trim_end- first and last frame to keep.trim_endof-1means "the final input frame," which is the default and saves you from counting. Your input is theimagebatch (or VIDEO frame source), and the output is just the kept frames.frame_hold+hold_frame- collapse to a single held frame instead of a range. Great for freeze-frames and "wait, that's the frame I want to actually look at" moments.repeat+repeat_mode- when you want the selection more than once:loop- play the range, then start over.bounce- play forward, then reverse (ping-pong). The classic seamless loop.reverse- the range played backwards.input_duration- repeat to match the length of the original input.custom_count- repeat a specific number of times, set bycustom_frame_count.freeze- repeat the first frame to fill the range.
Outputs are image and frame_count (INT). That frame count matters more than it looks - it's the number that tells everything downstream how long the sequence is, so you can chain lengths without counting by hand.
What it's for
Looping is the headline use. A 12-frame walk cycle loops cleanly; a 24-frame animation gets its tail trimmed so the loop point doesn't jump. Bounce is the sneaky-good one for anything that should sway - a flickering light, a pendulum, an idle character. And for AI video specifically, trimming the dead head/tail off a VHS-style decoded clip before it hits your encoder is routine.
Install
ComfyUI Manager (search "ComfyUI-Majoor-ImageOps"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/MajoorWaldi/ComfyUI-Majoor-ImageOps
Restart and hard-refresh the browser (Ctrl+F5 / Cmd+Shift+R). No models, no extra deps.
The gotchas
trim_end = -1 is your friend but it's easy to forget it's a sentinel - typing a huge number instead of -1 gives you "trim to last frame" anyway because the node clamps, but -1 is the intended way. For seamless loops, the classic mistake is looping a range that doesn't actually connect - frame 12 to frame 1 isn't a loop, it's a jump. Set the trim so the first and last frames of the selection are visually continuous, then loop or bounce just works. And remember it operates on the batch axis, so a still image with one frame needs a source that actually has multiple frames before trim/repeat has anything to chew on.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE,VIDEO | Image batch or video frames. | |
| bypass | BOOLEAN | false | — |
| trim_start | INT | 00–10000000 | — |
| trim_end | INT | -1-1–10000000 | -1 means last input frame. |
| frame_hold | BOOLEAN | false | — |
| hold_frame | INT | 00–10000000 | — |
| repeat | BOOLEAN | false | — |
| repeat_mode | COMBO | loop | 6 options: loop, bounce, reverse, input_duration, custom_count, freeze |
| custom_frame_count | INT | 241–10000000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| frame_count | INT | — |