Nodes/MKRShift_Nodes/Video Select Range By Frames
ComfyUI Node

Video Select Range By Frames

Cut by frame numbers instead of seconds — for when you know the frames

By criskb·Created 7 months ago·Updated 5 months ago· 0
Video Select Range By Frames
  • video
  • video
  • output_path
  • summary
start_frame0
end_frame0
fallback_fps24.0
output_formatauto
filename_prefixMKR_select_frames
subfolder
overwritefalse

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 with path, MKR_VIDEO payload, VHS-style dict).
  • start_frame - where to begin, 0-indexed, default 0.
  • end_frame - where to stop, default 0. Here's the one footgun: 0 doesn't mean "frame zero," it means "to the end of the clip." If you want a clip from frame 0 to frame 120, set end_frame to 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.

CategoryMKRShift Nodes/Media/Video/Edit

Inputs (8)

NameTypeDefaultDescription
video*
start_frameINT00–10000000
end_frameINT00–10000000
fallback_fpsFLOAT24.01–240
output_formatCOMBOauto6 options: auto, gif, webp, mp4, mov, webm
filename_prefixSTRINGMKR_select_frames
subfolderSTRING
overwriteBOOLEANfalse

Outputs (3)

NameTypeDescription
videoMKR_VIDEO
output_pathSTRING
summarySTRING