WanVideo Add StoryMem Latents
Giving Wan a memory across shots
- vae
- embeds
- memory_images
- image_embeds
The KB's Wan doc calls this out as the unsolved problem in local video: individual clips look great, but stitch several together and the character subtly stops being the same character. "You make a vid of person 1 talking, cut to a vid of person 2 doing something, then come back to person 1 and now their appearance is slightly different." StoryMem is a direct attempt at that problem - instead of chaining clips end-to-frame and hoping identity holds, you feed the model a set of reference images from earlier in the sequence as an explicit memory, and it conditions the current generation against them.
How it works
You give this node a handful of memory images - stills from earlier shots in your sequence, the ones you want the current clip to stay consistent with - and it VAE-encodes them into latents and folds them into your image embeds as an additional conditioning signal, alongside whatever start image or control you're already using. The model then has something concrete to reference beyond "whatever the text prompt implies the character looks like," which is the same basic idea behind reference-to-video approaches elsewhere in the Wan ecosystem, just aimed specifically at cross-shot consistency rather than a single generation.
The rope_negative_offset option is the more technical knob here. RoPE (rotary position embeddings) is how the model encodes where something sits in the sequence; offsetting it negatively for the memory frames is a way of telling the model "these frames come from earlier, don't treat them as part of the current timeline" - keeping the memory signal from bleeding into the motion of the shot you're actually generating.
The inputs that matter
vae (WANVAE) - needed to encode the memory images into latents, so this has to be the same VAE your main pipeline uses. embeds (WANVIDIMAGE_EMBEDS) - your existing image embeds, extended rather than replaced. memory_images (IMAGE) - the reference stills themselves; this is the input actually doing the creative work, so choose frames that clearly show the character/appearance you want carried forward. rope_negative_offset (boolean, default off) and rope_negative_offset_frames (default 5, 0–100) - whether to apply that positional offset, and how many frames' worth of offset to use if you do.
Output is a single image_embeds (WANVIDIMAGE_EMBEDS) that carries the memory conditioning forward into your sampler.
How to install it
Through ComfyUI Manager, search WanVideoWrapper and install; manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
then restart. No extra model download for this node specifically - it reuses your already-loaded Wan VAE - but you do need a VAE loader upstream feeding it.
Common issues & troubleshooting
This is a genuinely cutting-edge node with little community track record yet, so treat the following as reasoned expectations rather than reports from a mature user base.
Feed it images, not a video clip. memory_images wants stills that represent the identity/appearance you want held - pulling frames straight from a full clip usually works less well than a couple of clean, well-lit reference shots, the same lesson the KB's chunking discussion draws for other consistency techniques in this ecosystem.
Don't expect this to fully solve cross-clip drift on its own. Every long-form technique in the Wan ecosystem - chunked extension nodes, SVI's error-recycling LoRAs, reference-to-video conditioning - improves consistency without eliminating drift entirely. StoryMem is the same category of tool: it gives the model more to work with, not a guarantee.
If motion in the current shot looks contaminated by the memory frames (poses or backgrounds bleeding in from the reference stills), try enabling rope_negative_offset if it's off - that's specifically the knob meant to keep memory frames from being read as part of the current timeline.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | WANVAE | — | |
| embeds | WANVIDIMAGE_EMBEDS | — | |
| memory_images | IMAGE | — | |
| rope_negative_offset | BOOLEAN | false | Use positive RoPE frequency offset for the memory latents |
| rope_negative_offset_frames | INT | 50–100 | RoPE frequency offset for the memory latents |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_embeds | WANVIDIMAGE_EMBEDS | — |