Video Select Range By Frames
Cut by frame numbers instead of seconds — for when you know the frames
- video
- video
- output_path
- summary
MKRVideoSelectRangeByFrames keeps only the frames between a start_frame and an end_frame and writes the result out as a new clip. It's the frame-number sibling of MKRTrimVideoByTime - same idea, different ruler. Trim works in seconds; this works in frames. You reach for it when you're counting frames, not time.
When is frames the right ruler? When your source is frame-indexed to begin with - an image-sequence render, a generated video you're thinking of as "frames 40–120" rather than "1.6 seconds" - or when you need an exact cut at a frame boundary that doesn't land on a clean second. Trim-by-time can't give you "exactly frame 42 to frame 97" without math; this node gives it to you directly. The outputs are the standard trio: video (MKR_VIDEO payload), output_path, and summary.
The inputs that matter
video- any resolvable video (path string, dict withpath,MKR_VIDEOpayload, VHS-style dict).start_frame- where to begin, 0-indexed, default 0.end_frame- where to stop, default 0. Here's the one footgun:0doesn't mean "frame zero," it means "to the end of the clip." If you want a clip from frame 0 to frame 120, setend_frameto 120 explicitly - leaving it at 0 keeps everything.fallback_fps- only used if the source doesn't report a frame rate (so frame numbers can't be converted to time).output_format,filename_prefix,subfolder,overwrite- the standard pack inputs.
Install
Ships in MKRShift Nodes - install the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
or ComfyUI Manager → search MKRShift_Nodes → restart. mp4/mov/webm output needs system ffmpeg on PATH; gif/webp work without it. No pip dependencies.
Where people get burned
The end_frame default of 0 meaning "to the end" catches everyone at least once - you set start_frame: 0, end_frame: 0 expecting a single frame and get the whole clip. Also remember this is a frame-index cut, so if you set end_frame past the actual length, it clamps to the last frame rather than erroring - check the summary if the output length looks wrong. And, standard for the frame-based nodes here: no audio is carried through the cut, so mux sound back on if the source had any.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| video | * | — | |
| start_frame | INT | 00–10000000 | — |
| end_frame | INT | 00–10000000 | — |
| fallback_fps | FLOAT | 24.01–240 | — |
| output_format | COMBO | auto | 6 options: auto, gif, webp, mp4, mov, webm |
| filename_prefix | STRING | MKR_select_frames | — |
| subfolder | STRING | — | |
| overwrite | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| video | MKR_VIDEO | — |
| output_path | STRING | — |
| summary | STRING | — |