Nodes/ComfyUI-Majoor-ImageOps/〽️ Image Ops Frame Range
ComfyUI Node

〽️ Image Ops Frame Range

Trim, hold, loop, and reverse frame batches — the timeline editor in node form

By MajoorWaldi·Created 8 months ago·Updated 8 days ago· 11
〽️ Image Ops Frame Range
  • image
  • image
  • frame_count
bypassfalse
trim_start0
trim_end-1
frame_holdfalse
hold_frame0
repeatfalse
repeat_modeloop
custom_frame_count24

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_end of -1 means "the final input frame," which is the default and saves you from counting. Your input is the image batch (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 by custom_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.

Categoryimage/imageops

Inputs (9)

NameTypeDefaultDescription
imageIMAGE,VIDEOImage batch or video frames.
bypassBOOLEANfalse
trim_startINT00–10000000
trim_endINT-1-1–10000000-1 means last input frame.
frame_holdBOOLEANfalse
hold_frameINT00–10000000
repeatBOOLEANfalse
repeat_modeCOMBOloop6 options: loop, bounce, reverse, input_duration, custom_count, freeze
custom_frame_countINT241–10000000

Outputs (2)

NameTypeDescription
imageIMAGE
frame_countINT