WAN Geodesic Keyframes (LRW)
The heart of the WAN geodesic pipeline
- latent_start
- latent_end
- metric
- keyframe_latents
- latent_start
- info
This is the flagship node of comfyui-lrw-nodes - the one the author's announcement was built around. It takes the latent of your WAN first frame and the latent of your last frame, and generates intermediate geodesic keyframes between them: latents that sit on a smooth path through latent space instead of whatever straight-line mush the default interpolation would give you. Those keyframes are the "guide" that the rest of the WAN branch blends into your video latent.
How it works - and the honest caveat
For WAN, "geodesic" does not mean what it means on image models. The real pullback-metric geodesic needs VAE decoder Jacobians that WAN's VAE can't cheaply do, so this node defaults to lrw_interpolate_try: it tries to initialize the LRW GeodesicSolver, and if that fails or demands a dense D×D metric, it safely falls back to a norm-preserving spherical SLERP. That fallback is the actual workhorse - O(K·B·D), no giant matrix, no vmap, no VAE decode in the loop. It's an approximation, deliberately, so it fits in VRAM. The author's source calls it out in so many words: "This is not a WAN VAE pullback-metric geodesic." Respect that honesty and you'll be happier with the results.
The info string output tells you which backend actually ran, plus diagnostics: the SLERP angle between your endpoints, a mid-norm ratio (near 1.0 = stable), and VRAM used. Read it once when you're setting up - it's the best way to confirm your fallback isn't silently doing something weird.
The inputs that matter
There are a lot, but a beginner sets these:
latent_start,latent_end- first and last frame latents (VAEEncode your two images).metric- fromLRW_WanTemporalMetric.n_keyframes(default 3, tooltip: 2–3 recommended for 16GB) - how many intermediate keyframes.vram_mode-auto/low_12gb/mid_16gb(default) /high_24gb. Sets the chunking so you don't spike memory.backend- leave atlrw_interpolate_try; switch tosafe_slerpif you want guaranteed behavior,lerp_debugto compare against plain linear interpolation.keyframe_output_layout- defaultwan_5d. Leave this alone unless you know better. The tooltip says it all: usewan_5dbefore WAN VAEDecode, it prevents theshape[4]IndexError.
n_geodesic_steps and geodesic_step_size only matter when the real LRW solver path runs; the safe_slerp fallback ignores them.
Outputs
keyframe_latents- the stacked(B×K, C, 1, H, W)latent batch. Feed it toLRW_LatentKeyframePicker(pick one) or straight toLRW_WanLatentGuideBlend.latent_start- your start latent, passed through so the graph stays tidy.info- the diagnostics string above.
Install & gotchas
Search comfyui-lrw-nodes in ComfyUI Manager, or git clone https://github.com/lajjadred/comfyui-lrw-nodes into ComfyUI/custom_nodes, pip install -r requirements.txt, restart. Real deps: latent-riemannian-world >= 0.3.0, torch >= 2.4. The demo also expects ComfyUI-GGUF, WanFirstLastFrameToVideo, and VideoHelperSuite. Early pack builds had an import bug that made nodes show as broken/UNKNOWN - fixed upstream, so git pull + full restart, and keep only one copy in custom_nodes. License is BSL-1.1. And one reminder from the author's own thread: this is a soft guide, not a quality booster - its job is nudging motion timing, not rescuing bad prompts.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| latent_start | LATENT | — | |
| latent_end | LATENT | — | |
| metric | METRIC | — | |
| n_keyframes | INT | 31–16 | Number of intermediate keyframes. 2-3 recommended for 16GB VRAM. |
| n_geodesic_steps | INT | 205–100 | Only used when initializing lrw GeodesicSolver. safe_slerp does not need dense integration. |
| geodesic_step_size | FLOAT | 0.0500.001–0.5 | — |
| vram_mode | COMBO | mid_16gb | 4 options: auto, low_12gb, mid_16gb, high_24gb |
| backend | COMBO | lrw_interpolate_try | 3 options: lrw_interpolate_try, safe_slerp, lerp_debug |
| output_dtype | COMBO | same | 4 options: same, fp16, bf16, fp32 |
| keyframe_output_layout | COMBO | wan_5d | Use wan_5d before WAN VAEDecode. This prevents shape[4] IndexError. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| keyframe_latents | LATENT | — |
| latent_start | LATENT | — |
| info | STRING | — |