FunPack StoryMem Last Frame Extractor
The simplest node in FunPack, and the one that keeps your shots in a row
- frames
- last_frame
- motion_frames
The name is a mouthful, but the FunPack StoryMem Last Frame Extractor is the easiest node in this pack. You feed it a batch of frames and it hands you back the last frame and the last few frames, split into two outputs. That's it. No LLM, no ratings, no settings beyond a single number. In a pack full of self-learning samplers and browser editors, it's a relief.
Why you'd reach for it
The whole point is shot continuity. Video models are notoriously bad at remembering what the previous clip ended with - each generation starts fresh, and a character's face, lighting, or background quietly wanders between shots. The fix used by FunPack's own "StoryMem" workflow (the pack ships a Wan22_LongVideoGen_StoryMem example that runs this node) is to carry the end of one clip into the start of the next.
So this node sits at the seam between two generations: the last frame of clip A becomes the reference image for clip B. That's the last_frame output - the single frame an image-to-video node wants. The motion_frames output is the whole trailing tail, which some workflows use as extra temporal context so the model understands how things were moving, not just what the last still looked like. If you're doing multi-image or multi-modal continuation (the MI2V/MM2V in the description), that motion tail is what keeps a pan or a walk from restarting mid-shot.
What you actually set
Two inputs, one of which you'll touch:
- frames (IMAGE) - your video frame batch.
- n_frames (INT, default 5) - how many trailing frames land in
motion_frames, from 1 to 20.
Keep n_frames small. Five is plenty for motion context, and big values just waste VRAM on frames the model barely uses. The tooltips say it plainly: n_frames is "for MM2V", so it exists for the Wan multi-modal paths.
Outputs are last_frame (single-frame IMAGE) and motion_frames (the last n_frames). Wire last_frame into your i2v node's image input and you're done. There's no error state worth worrying about - unlike its sibling FunPack Continue Video, this one won't throw if you ask for more frames than exist; it just clamps to what's there.
Install
This ships in ComfyUI-FunPack, so you get it with the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/olivv-cs/ComfyUI-FunPack
pip install -r requirements.txt
or just search "ComfyUI-FunPack" in ComfyUI Manager and restart. It's a pure tensor-slicing node - no model downloads, no extra dependencies beyond what the pack already needs. It'll work even if you never install the optional stuff.
Where it fits
FunPack's bigger promise - the self-improving generation engine, the Cutting Room editor, the Refiner that learns your taste - is all downstream of "keep the shot from drifting." This node is the boring plumbing that makes a multi-clip workflow behave like one long take instead of a series of disconnected generations. Cheap, deterministic, and exactly as advertised.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | — | |
| n_frames | INT | 51–20 | Number of frames to extract from end (for MM2V) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| last_frame | IMAGE | — |
| motion_frames | IMAGE | — |