Anchor Frame Extractor
Pull clean context frames out of a compressed video
- images
- anchor_frames
- anchor_data
- report
When you compress a long video down to a context window, you get repeats - key frames held for several slots so the model can see them. Those repeats are great for the model but useless as "the state of the scene" if you want one clean frame per story beat. Anchor Frame Extractor takes Frame Context Fit's compressed output and pulls exactly one anchor frame out of each key-frame group.
It's a precision companion to Frame Context Fit, which does the compression. Feed this node the same images batch plus the JSON key_frame_data that Frame Context Fit emits, and you get back anchor_frames - one frame per key-frame group - plus anchor_data and a report describing what was picked and why.
How it works
Frame Context Fit structures its output as repeating segments: [key frame × repeats] [eased intermediates] [key frame × repeats] .... The key_frame_data JSON records where each key-frame group starts in the output. Anchor Frame Extractor reads that map and, for each group, picks a frame according to pick_position:
second_to_last(default) - the frame just before the final repeat of the key frame. This is the clever default: it's the point where the model has had a full look at the key frame, so the anchor is a "settled" version rather than the first noisy exposure.first,middle,last- the alternatives, depending on whether you want the initial, midpoint, or final exposure of each group.
The outputs give you options: anchor_frames (the IMAGE batch), anchor_data (JSON with the source indices so you can trace each anchor back to the original timeline), and report (a human-readable summary of the picks).
Inputs that matter
images(IMAGE) - the compressed sequence, straight out of Frame Context Fit'simagesoutput.key_frame_data(STRING) - the JSON from Frame Context Fit'skey_frame_dataoutput. The tooltip is explicit about where it comes from; grab the wrong output and you'll get a mismatch.pick_position(enum) - how to choose within each group. Default is fine for most workflows.
Where it fits
In an iterative video pipeline, anchor frames are what you feed back as context on the next pass, or what you use to check "did the scene stay coherent?" before committing to more iterations. They're also useful as the seed set for a character-sheet workflow - the pack is by Mickmumpitz, whose whole channel is about consistent characters, and these context frames are the "what the scene should still look like" reference.
Installing
Part of Mickmumpitz-Nodes - ComfyUI Manager → search "Mickmumpitz" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes
Light deps (numpy, Pillow, opencv-python), nothing to download.
Gotchas
The one real failure mode is feeding it compressed images without the matching key_frame_data - the node can't infer group boundaries reliably from the images alone, so keep the pair together. Also, if you tweak Frame Context Fit's settings after extracting anchors, re-extract: the group structure changed even though the images look similar. It's a small node with a narrow job, but when you're chaining compressed video through multiple passes, it's the difference between knowing your context and guessing at it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| key_frame_data | STRING | JSON key frame data from Frame Context Fit's key_frame_data output. | |
| pick_position | COMBO | second_to_last | Which frame to pick from each key-frame repeat group. 'second_to_last' picks the one before the last repeat. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| anchor_frames | IMAGE | — |
| anchor_data | STRING | — |
| report | STRING | — |