Sample Video Frames (Images)
The frame-picker built for LLM video conditioning
- video
- image batch
- images
- timestamps
- timestamps text
- timeline text
- video runtime
- structured timeline text
You've got a video, and you want a handful of its frames as images - but not just any frames, and not just as an image batch: you want them aligned to timestamps, as a list, with the <Picture N> references formatted for pasting straight into a video-model prompt. That's the oddly specific job this node does, and it does it better than the generic "extract frames" loops most workflows used to hack together.
What it does
Feed it a Core VIDEO input and it samples presentation-timestamp-aligned frames, then hands you the same frames in several forms at once: an image batch (IMAGE, chronological, good for direct sampling), an images list (IMAGE, one entry per frame, independently mappable), and a stack of text outputs - timestamps, timestamps text, timeline text, and structured timeline text - all formatted consistently and ready to drop into a prompt.
The default timeline_style is "H3 alignment prefix," which is a tell: this node was built for the pack's MiniMax H3 / Qwen video-reference workflows, where the prompt references images as <Picture N> entries with timestamps. The index_offset input exists so you can reserve the first indices for earlier reference images and let this node's frames start later in the numbering. If you're not on an H3 workflow, the "timestamps only" or "zero-based indexed" styles give you the same data in plainer form.
The settings that matter
sampling_strategy-codec keyframes(default) keeps only actual codec keyframes (low redundancy);uniform PTSspaces frames evenly across the video;focused PTSgroups frames around specific moments.focus_areas(0–3) +focus_one/two/three(0–1 each) - focused mode splits the video into up to three parts and each focus value says where in that part the frames cluster (0 = early, 0.5 = balanced, 1 = late). Want the interesting motion at 70% through the clip? Set focus to 0.7.maximum_frames(default 16; 0 = keep every eligible frame) andminimum_spacing_seconds(default 0.25) - together they cap output and enforce a floor between frames, so you don't get a burst of near-duplicate frames.include_zero_time(default on) normalizes the first visible frame to position 0 - the timestamp reference everyone expects.keyframe_stride- keyframe mode only; keep every Nth keyframe before spacing and count limiting.timestamp_formatandtimeline_style- cosmetic, but they set exactly how the text outputs read.
Outputs you'll actually wire: image batch into a sampler, the timeline text / structured timeline text into a prompt, and video runtime when you need the active duration (including any trim) in seconds.
Install
Part of ComfyUI-UtilsCollection:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
Restart, or install via ComfyUI Manager (search "UtilsCollection"). No model downloads - this is pure frame extraction. Requires Core's VIDEO type, which means a reasonably recent ComfyUI.
Gotchas
Keyframe mode depends on the codec actually having keyframes; highly compressed web sources may yield fewer than you expect - bump maximum_frames or switch to uniform PTS if your picks look sparse. And remember the pack-level housekeeping: UtilsCollection re-registers node IDs from several older packs, so accept ComfyUI's "replace node?" prompt when loading older workflows and you'll be on the current implementation.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| video | VIDEO | Core VIDEO input to sample. | |
| sampling_strategy | COMBO | codec keyframes | Choose which video frames to keep. Focused PTS groups frames around the focus settings. |
| maximum_frames | INT | 16 | Maximum total output count, including the zero-time frame. 0 returns every frame eligible after spacing and stride. |
| focus_areas | INT | 00–3 | Focused PTS only. How many parts to split the video into. 0 spaces frames evenly. |
| focus_one | FLOAT | 0.500–1 | Focused PTS only. Where frames group in the first part. 0 is early, 0.5 is balanced, 1 is late. |
| focus_two | FLOAT | 0.500–1 | Focused PTS only. Where frames group in the second part. 0 is early, 0.5 is balanced, 1 is late. |
| focus_three | FLOAT | 0.500–1 | Focused PTS only. Where frames group in the third part. 0 is early, 0.5 is balanced, 1 is late. |
| include_zero_time | BOOLEAN | true | Place the first visible frame at output position 0 and normalize its presentation timestamp to zero. |
| minimum_spacing_seconds | FLOAT | 0.25 | Minimum presentation-time separation between selected frames. |
| keyframe_stride | INT | 1 | For codec keyframes only, retain every Nth raw codec keyframe before spacing and count limiting. |
| timestamp_format | COMBO | 00.000s | Formatting reused verbatim by every text output. |
| timeline_style | COMBO | H3 alignment prefix | Scalar timeline text: full H3 alignment prefix, compact H3 <Picture N>, zero-based indexed, or timestamps only. |
| index_offset | INT | 0 | Adds this value to every <Picture N> reference so earlier reference images can occupy the first indices. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| image batch | IMAGE | Selected frames as one chronological IMAGE batch. |
| images | IMAGE | Selected frames as aligned single-image list entries. |
| timestamps | STRING | Formatted timestamps aligned with the image list. |
| timestamps text | STRING | All formatted timestamps joined into one comma-and-space-separated string. |
| timeline text | STRING | One concatenation-ready timeline string. |
| video runtime | FLOAT | Full active VIDEO duration in seconds, including the active trim. |
| structured timeline text | STRING | Video duration, segment count, and chronological <Picture N> timestamp references in one sentence. |