Nodes/comfyui-lrw-nodes/WAN Temporal Metric (LRW)
ComfyUI Node

WAN Temporal Metric (LRW)

The VRAM-safe stand-in metric for WAN

By lajjadred·Created 3 months ago·Updated 3 months ago· 12
WAN Temporal Metric (LRW)
  • vae
  • latent
  • metric
regularization0.0000
precisionfp16
chunk_frames1

Every LRW node needs a METRIC, and on WAN you can't build the real one. The real pullback metric requires decoding through the VAE and computing a Jacobian, and WAN's VAE decoder simply isn't vmap-safe - it throws or OOMs on consumer GPUs. So this node hands you a lightweight stand-in: a metric descriptor that's compatible with the LRW API but doesn't decode anything, doesn't touch a Jacobian, and never builds a giant D×D matrix. It's the first node in the WAN branch of the pack for a reason.

Here's the honest bit you should absorb immediately: because the metric is a cheap approximation, the "geodesics" you compute downstream on WAN are not true decoder-pullback geodesics. The author's own source says it plainly - it's a norm-preserving spherical geodesic approximation. That's a deliberate trade to keep the workflow running on 12–16GB cards, and it's a good trade. Just don't go around claiming your WAN interpolation is mathematically exact.

What it actually does

It takes your latent, reads off its dimensionality, and constructs a _SafeLatentMetric that reports the flat-ish geometry the rest of the WAN nodes expect. Check the source and you'll spot something funny: vae is a required input, but the node never uses it. It's there for interface symmetry (so the WAN branch reads like the image-model branch) and to anchor the VAE shape context, but the computation is latent-only. precision (default fp16) and chunk_frames (default 1) exist to keep memory bounded on large WAN latents; you can usually leave both alone.

Inputs: vae, latent, regularization (default 1e-5), precision, chunk_frames. Output: one metric, which feeds straight into LRW_WanCurvatureGuide and LRW_WanGeodesicKeyframes.

How it fits the WAN workflow

The pack's recommended WAN2.2 First-Last Frame pipeline is: first+last images → WanFirstLastFrameToVideo for the base video latent, and separately first+last → VAEEncode → this node (with the metric) → LRW_WanGeodesicKeyframesLRW_WanLatentGuideBlend → KSampler. So this node is the foundation of the LRW guide branch. The goal, per the author's r/comfyui thread: WAN2.2 FLF is great at arriving at the last frame, but with big pose/framing changes the intermediate motion can be abrupt or delayed - the clip lingers on the first frame too long, then jumps. The LRW geodesic branch softly nudges the intermediate latent direction so motion starts earlier and distributes more evenly.

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. The real dependency is latent-riemannian-world >= 0.3.0 plus torch >= 2.4; Python 3.12+. The WAN demo workflows additionally expect ComfyUI-GGUF (UnetLoaderGGUF), WAN2.2 First-Last Frame support (WanFirstLastFrameToVideo), and ComfyUI-VideoHelperSuite (VHS_VideoCombine). The pack's early registration bug (nodes showing broken/UNKNOWN) is fixed upstream - git pull + full restart, one copy in custom_nodes. License is BSL-1.1.

Categorylrw/wan

Inputs (5)

NameTypeDefaultDescription
vaeVAE
latentLATENT
regularizationFLOAT0.00001e-8–0.1
precisionCOMBOfp163 options: fp16, fp32, bf16
chunk_framesINT11–8

Outputs (1)

NameTypeDescription
metricMETRIC