Nodes/Pond Nodes/🐳Video Frame Extractor
ComfyUI Node

🐳Video Frame Extractor

Pick your video frames on a timeline

By Pondowner857·Created about a year ago·Updated 27 days ago· 45
🐳Video Frame Extractor
  • video
  • image
frame_index0
total_frames-1

Most video nodes make you type start_frame and end_frame as raw numbers and hope you guessed right. Video Frame Extractor 🎞️ does the thing you actually want: it puts a DAW-style timeline right inside the node - filmstrip thumbnails, a brightness waveform, a zoomable timecode ruler - and you drag a loop region to choose your clip. The frame batch comes out the other side as a normal ComfyUI IMAGE tensor, ready for whatever comes next. If you've ever burned three runs because you were off by four frames, this fixes that particular annoyance.

It's a one-trick pack - a single node, no model downloads, no API keys, nothing to fine-tune. The author (ComfyUI-Attic on reddit, comfyuiattic-989 on GitHub) built it for prepping WAN training clips, which tells you the target use case: get an exact window of frames out of a source video and into a workflow without leaving the graph.

How it works

The backend is plain OpenCV under the hood - cv2.VideoCapture reads the metadata and pulls frames, converted to BGR→RGB and normalized to float32 tensors in [0, 1], shaped (N, H, W, 3). That's the format ComfyUI's VAE Encode expects, so the output wires straight into a sampler path. There's no ffmpeg and no PyAV; what your OpenCV build can decode is what the node can extract.

The interactive part lives in the frontend. The node registers a couple of small API endpoints - /video_frame_extractor/info for metadata and /video_frame_extractor/thumbnail for individual frames - and the JS renders those thumbnails as the filmstrip you drag on. One thing worth knowing: each frame is fetched by seeking (cap.set(CAP_PROP_POS_FRAMES) per frame), so extraction is seek-based rather than a fast sequential decode, and the target-FPS pass reads the same span a second time. Fine for a few hundred frames, noticeably slower on feature-length files.

The genuinely thoughtful part is the memory guard. The node estimates peak RAM from frame count, resolution, and target_fps (it keeps the forward batch, a reversed copy, and a resampled batch resident), and refuses to run a clip that would blow past the limit - 75% of your system's available RAM if psutil is installed, a fixed 8 GB otherwise. So instead of freezing ComfyUI on an oversized extraction, you get a clear RuntimeError telling you to shorten the loop.

The inputs that matter

  • video - the file picker. Drop a file in ComfyUI/input/ and pick it from the dropdown, or use the Choose Video to Upload button. MP4, AVI, MOV, MKV, WebM are supported; anything else your OpenCV build decodes.
  • start_frame / end_frame - you mostly won't touch these; dragging the indigo loop handles sets them for you, and they stay in sync.
  • target_fps - default 24.0. Drives the Clipped Frames at Target FPS output, which resamples your loop to that frame rate (handy for feeding a model that expects a specific length or FPS).

num_frames exists but is hidden on the node - it auto-computes from the loop span and syncs internally, so don't go hunting for it.

The outputs

There are ten pins, and you'll use maybe half. The big ones: Clipped Frames (the batch, forward order), Reversed Clipped Frames (same frames flipped - the author calls this the sleeper hit, because forward + reversed into a Video Combine gives a seamless ping-pong loop), and Clipped Frames at Target FPS. First Frame and Last Frame are handy for init-image work. The rest are metadata you wire when needed: Filename Prefix (no extension) feeds a Save Image prefix automatically, plus Width, Height, Original FPS, and a Target FPS passthrough.

Installing it

Via ComfyUI Manager - the recommended path - search for Video Frame Extractor and hit Install, then restart ComfyUI. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/comfyuiattic-989/ComfyUI-Video-Frame-Extractor
cd ComfyUI-Video-Frame-Extractor
pip install -r requirements.txt

Dependencies are light: opencv-python >= 4.7, Pillow, numpy, with psutil optional (torch comes from ComfyUI). No models, no weights, nothing to hunt down - one of the rare packs that just works after install.

Common issues

  • "Prompt has no outputs" when you only connect one pin - a 1.3.0 bug fix; the node is now an output node. Update if you still hit it.
  • Red error overlay / video won't load - that's your OpenCV build lacking the codec. H.264 in an .mp4 is the safe default; uncommon containers depend on your OpenCV's ffmpeg build.
  • "Refusing to run: estimated peak memory…" - shorten the loop region, drop target_fps, or use a lower-res video. Without psutil installed the guard is stuck at 8 GB, which is stingy on a 64 GB box; pip install psutil makes it adapt to your machine.
  • The upload button takes up a lot of canvas space. That's a ComfyUI quirk the author already knows about; the collapsible preview section helps.

Typical flow: extract a clip → VAE Encode → KSampler for frame-by-frame video-to-video, or batch the frames for LoRA training data. For one light dependency, it turns the most fiddly part of video work - picking the right frames - into a drag.

Category🐳Pond/video

Inputs (3)

NameTypeDefaultDescription
videoIMAGE
frame_indexINT00–9999
total_framesoptINT-1-1–9999

Outputs (1)

NameTypeDescription
imageIMAGE