Nodes/Qwen2.5-VL GGUF Nodes/🎞️ Video Frame Sampler
ComfyUI Node

🎞️ Video Frame Sampler

Your VLM doesn't need all 600 frames — give it the 8 that matter

By walke2019·Created 11 months ago·Updated about a month ago· 32
🎞️ Video Frame Sampler
  • video
  • frames
  • indices
max_frames8
strategyuniform

Vision models can "watch" video, but they do it by looking at frames - and feeding a VLM 600 consecutive frames from a 20-second clip is how you burn through your context window, your token budget, and your patience. Video Frame Sampler is the pack's answer: it takes an IMAGE batch (which is how ComfyUI represents video - every frame is one image in the batch) and returns a smaller, representative subset. Feed the output to a VLM and it sees the whole story, not just frame 1.

This is the node you want when the VLM's own built-in video handling would either sample badly or blow your budget. It's also deterministic and cheap - pure numpy tensor slicing, no model, no network.

The three inputs

  • video - the IMAGE batch. Comes from any video-loading node that outputs frames.
  • max_frames - how many frames you want out, default 8, up to 64. This is your context-budget knob.
  • strategy - uniform, head, or tail:
    • uniform spreads the picks evenly from first to last frame - the default, and almost always the right choice. First frame, last frame, and evenly spaced in between.
    • head takes the first N frames.
    • tail takes the last N frames.

Outputs

  • frames - the sampled IMAGE batch, ready for a batch VLM runner or a local V2 analysis node.
  • indices - a comma-joined STRING of the original frame indices you kept (e.g. 0,85,171,...). That string is easy to underestimate, but it's genuinely useful for mapping results back to the timeline - knowing "the VLM saw frame 171" tells you what part of the video a caption is describing.

Where it fits and where it doesn't

The intended pipeline is: video → frames → Video Frame Sampler → a batch/multi-image VLM node → results. The VLM Model Advisor in this pack even recommends this exact pattern for the video/视频理解 task, which is a nice sign the authors actually use their own advice.

The honest limitation: uniform sampling misses changes. A shot that lasts 3 seconds out of 60 gets one frame even if it's the most important shot in the video. If your job is detecting brief events, uniform sampling will miss them and you'll want a smarter selector - but for captions, summaries, and content analysis of typical footage, uniform is a solid default that communities keep coming back to.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/walke2019/ComfyUI-GGUF-VLM.git
cd ComfyUI-GGUF-VLM
pip install -r requirements.txt

Restart ComfyUI. Under GGUF-VLM → 🚀 Business. It only slices tensors, so it works even if you've skipped the heavy model dependencies.

Troubleshooting

If indices looks like 0,1,2,3,4,5,6,7 for a long video, you probably fed it a single image batch, not actual video frames - the node can only sample what the batch dimension tells it. And remember max_frames caps at 64: if you sample 64 frames and the VLM still chokes, the problem is the downstream model's context handling, not this node - drop max_frames or use a remote model with a bigger window.

Category🤖 GGUF-VLM/🚀 Business

Inputs (3)

NameTypeDefaultDescription
videoIMAGE
max_framesINT81–64
strategyCOMBOuniform3 options: uniform, head, tail

Outputs (2)

NameTypeDescription
framesIMAGE
indicesSTRING