π π £π § Sample Video MotionCache
LTX-2.3 sampling, minus the wasted steps
- transformer
- vae_decoder
- config
- motion_cache
- vae_encoder
- sampled_video
- motioncache_stats
If you're on LTX-2.3, you already know the drill: the model is fast, but every denoising step still re-does work that barely changed since the last step. This node is the MotionCache path to cutting that waste - it replaces the LTX sampler with a loop that reuses previous results for the tokens that aren't really moving, and skips re-computing CFG/STG guidance on the steps in between.
Use this one when your workflow already decodes LTX_SAMPLED_VIDEO later. It hands you a sampled latent you decode downstream, so it slots into graphs that have their own decode stage. If you'd rather get frames straight out and pipe them into VHS_VideoCombine, its sibling Ltx23GenerateVideoMotionCache is the one.
How it works
The core idea comes from MAC-AutoML/MotionCache - not a port, but an engineering rebuild for LTX-2.3's modular sampling. Looking at the source, the node patches the LTX validation sampler's denoising loop and runs its own version:
- It keeps the previous step's denoised
x0around, then compares it to the current one. Tokens whose denoised output barely changed (low "motion") get the cached value back instead of a fresh prediction. - Between forced refresh steps it caches the CFG delta and the STG delta - the extra guidance forwards (negative prompt, perturbation) are the expensive part of an LTX step, and on non-refresh steps it just adds the cached delta. With the default
refresh_intervalof 3, roughly two out of every three steps skip those extra forwards entirely. That's where the time actually goes.
Be honest about the tradeoff while you tune: this is a sampler-replacement node, so it carries the risk caching always carries - if you push it too hard, slow motion in the video can freeze or smear. That's what the stats output is for.
Inputs and outputs
The required inputs are the same four as the official LTX modular sampler:
transformer(LTX_TRANSFORMER) - your loaded LTX-2.3 transformer.vae_decoder(LTX_VIDEO_VAE_DECODER) - the decoder.config(LTX_SAMPLING_CONFIG) - your sampling config, the thing that carries steps, resolution, frame count, prompts.motion_cache(LTX23_MOTION_CACHE_CONFIG) - the config object from theLtx23MotionCachenode. That node is where all the tuning knobs live.
One optional input matters a lot: vae_encoder (LTX_VIDEO_VAE_ENCODER). It's optional on the schema but required in practice for any I2V, image-conditioning, reference-video, or mask-edit workflow - the code throws an error if you have conditioning set and no encoder wired in. Keep the encoder connected and you're covered for all paths.
Outputs:
sampled_video(LTX_SAMPLED_VIDEO) - the sampled result, decode it with an LTX decoder node later.motioncache_stats(STRING) - a text summary of the run: step count, average/min/max update ratio, refresh interval and threshold. Wire it to a text display node and it becomes your tuning dashboard: ifavg_update_ratiosits near the max, the cache is barely engaged; if it's near the min, you're probably over-reusing.
Installing
The pack is starsFriday/ComfyUI-LTX23-MotionCache. ComfyUI Manager can find it by searching "LTX23 MotionCache", or install it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/starsFriday/ComfyUI-LTX23-MotionCache
Then restart ComfyUI. There are no pip dependencies, which is nicer than most. The catch is a different one: this node imports ltx_core and ltx_trainer from the LTX-2 source tree at runtime. If those aren't installed as Python packages, point the pack at the repo:
export LTX2_REPO_ROOT=/path/to/LTX-2
That path needs packages/ltx-core/src, packages/ltx-trainer/src, and packages/ltx-pipelines/src. Also note the pack bundles no LTX-2.3 weights or loaders - it expects a working LTX-2.3 environment (the official ComfyUI-LTXVideo nodes) already installed.
Common issues
- "vae_encoder is required for I2V / IC / Mask workflows" - you're doing conditioning without an encoder. Wire one in; it's the single most likely error on this node.
- Import error about
ltx_core/ltx_trainer- the LTX runtime isn't importable. SetLTX2_REPO_ROOTas above. - Video feels still or smeared on fast motion - that's over-reuse. Raise
min_update_ratio, lowerrefresh_interval, or dropmotion_thresholdon the config node. - Confusingly slow - if the motion cache is effectively off (e.g.
warmup_stepsandrefresh_intervalhigh enough that almost every step is a refresh), you're paying loop overhead for nothing. Check the stats string: a healthy run shows anavg_update_ratiowell under 1.0.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| transformer | LTX_TRANSFORMER | β | |
| vae_decoder | LTX_VIDEO_VAE_DECODER | β | |
| config | LTX_SAMPLING_CONFIG | β | |
| motion_cache | LTX23_MOTION_CACHE_CONFIG | β | |
| vae_encoderopt | LTX_VIDEO_VAE_ENCODER | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| sampled_video | LTX_SAMPLED_VIDEO | β |
| motioncache_stats | STRING | β |