Nodes/ComfyUI Essentials/πŸ”§ Extract Keyframes (experimental)
ComfyUI Node Runs on cloud

πŸ”§ Extract Keyframes (experimental)

Thin a frame batch down to what actually changed

By cubiqΒ·Created 3 years agoΒ·Updated about a year agoΒ· 1,155
πŸ”§ Extract Keyframes (experimental)
  • image
  • KEYFRAMES
  • indexes
β—„threshold0.85β–Ί

Hand this a batch of frames - a decoded video, a long image sequence - and it hands back only the ones that actually changed enough to matter. That's useful for two things: cutting a long, mostly-static batch down to the moments something happened, or picking out a set of true keyframes to run through a heavier process while everything in between gets interpolated later.

How it works

For each frame, the node compares it against the last frame it decided to keep, not against every other frame in the batch - that's the standard rolling-comparison pattern behind every keyframe/scene-cut detector. threshold (0–1, default 0.85) is the similarity gate: when a frame's similarity to the last kept keyframe drops below that threshold, it's different enough to count as a new keyframe and gets kept.

Inputs and outputs

Required: image (a batch) and threshold. Outputs: KEYFRAMES (an IMAGE - the kept frames) and indexes (a STRING - the positions in the original batch that survived, so you can line the keyframes back up against the source sequence later).

Installing it - and one thing to check first

Via ComfyUI Manager, search "ComfyUI Essentials". Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cubiq/ComfyUI_essentials

Restart. Worth flagging directly: this node is marked "(experimental)" in its own display name, and unlike every other node in this pack, our own catalog data doesn't show it resolving to the pack's Python module the normal way - the rest of essentials' nodes all report custom_nodes.ComfyUI_essentials as their source module; this one doesn't. If it doesn't show up in your node search after installing, check your ComfyUI startup console for an import error tied specifically to this class before assuming your install is broken - the rest of the pack loading fine doesn't mean this one node did.

The pack overall has been in maintenance-only mode since April 2025, so an experimental node with rough edges is genuinely likely to just... stay that way.

Common issues & troubleshooting

Too many frames survive. Lower threshold - you're currently keeping frames that are only mildly different from the last keyframe. A lower threshold means only bigger jumps count as "new."

Almost the whole batch gets kept, no matter what you set the threshold to. That usually means your source footage is genuinely busy - camera movement, sensor noise, film grain - every frame really is different from the last one. Stabilizing or lightly denoising the source before extraction can help more than tuning the threshold further.

The node's missing entirely from your install. See the module-resolution note above - that's the first thing to check, not your git clone.

Categoryessentials

Inputs (2)

NameTypeDefaultDescription
imageIMAGEβ€”
thresholdFLOAT0.850–1β€”

Outputs (2)

NameTypeDescription
KEYFRAMESIMAGEβ€”
indexesSTRINGβ€”