Nodes/ComfyUI S4Motion/đź’€Video Frames
ComfyUI Node

đź’€Video Frames

Pull a slice of the timeline out of your clip

By S4MUEL-404·Created about a year ago·Updated 11 months ago· 4
đź’€Video Frames
  • video
  • image
  • Frame
â—„start_frame0â–ş
â—„frame_count1â–ş
â—„background_typetransparentâ–ş
â—„background_color#000000â–ş

Sometimes you don't want the whole clip - you want a window out of the middle of it. đź’€Video Frames grabs a slice of a video or image sequence by frame range and hands you just those frames. It's the S4Motion node you reach for when you need a single still for a dataset, or a shorter segment to feed to a model that caps its input length.

It takes a video (VIDEO object) or an image (IMAGE sequence) and outputs one Frame output - the extracted batch.

Inputs that matter:

  • start_frame - where to begin. Default 0.
  • frame_count - how many frames to take. Default 1, so with defaults it returns a single still. That's a legit use: pull one frame out of a clip for a thumbnail or a training sample.
  • background_type / background_color - same as đź’€Video Crop. transparent (default) keeps alpha, solid_color fills the frame's background with your hex color. This matters when the extracted frames carry alpha or when you want them composited onto a solid backdrop before they go downstream.

The mechanism is the pack standard: VIDEO input gets decoded via OpenCV, IMAGE input via Pillow, and then the node returns frames from start_frame up to start_frame + frame_count. Frames outside that window are simply not loaded - extraction is a slice, not a re-encode.

Install

ComfyUI Manager → search "S4Motion" → install → restart, or:

cd ComfyUI/custom_nodes/
git clone https://github.com/S4MUEL-404/ComfyUI-S4Motion.git
pip install -r ComfyUI-S4Motion/requirements.txt

Gotchas

  • OpenCV is required for VIDEO input. Feed it a video object without opencv-python installed and you'll get the pack's standard "OpenCV is required for video processing but not available" error. IMAGE sequences work with Pillow only.
  • The background settings apply to the extracted frames, which is a slightly different job than the crop node's job. If your source frames are RGB, transparent won't add an alpha channel out of nowhere - it mostly matters for sources that already have alpha.
  • No frame-rate awareness. The range is in raw frame indexes, not seconds. To pull frames from 1.0s to 1.5s of a 30fps clip, that's start_frame 30, frame_count 15 - use đź’€Video Info's fps output if you don't want to do the math in your head.

The whole pack is basically un-discussed on reddit, and this node is one of the quieter members, so there's no lore to learn - it's a plain slice tool. Use it with Video Info to check counts and you'll never have to guess your range again.

Categoryđź’€S4Motion

Inputs (6)

NameTypeDefaultDescription
start_frameINT00–9999—
frame_countINT11–9999—
background_typeCOMBOtransparent2 options: transparent, solid_color
background_colorSTRING#000000—
videooptVIDEO—
imageoptIMAGE—

Outputs (1)

NameTypeDescription
FrameIMAGE—