LTX2 Efficient Video Sampler
Keeping LTX-2 alive on a 6GB card
- model
- latent_video
- positive
- negative
- sigmas
- LATENT
LTX-2 is fast for what it is - Lightricks' 19B model that does synchronized video and audio - but on a consumer GPU it has a dirty secret: the attention cost is quadratic in frames × spatial tokens, so your card pegs at 100% and your temps climb while it "runs." This node is a drop-in sampler replacement that fights back with three ideas: freeze the parts of attention that stop mattering, throttle against a target temperature, and optionally sample keyframes instead of every frame. It's the flagship of the kakachiex2/comfyui-ltx2-efficient pack, aimed squarely at people on 6GB cards like the author's own RTX 2060.
What it replaces and how it works
You wire it exactly like the KSampler in a normal LTX-2 pipeline: model, latent_video, positive, negative go in, a LATENT comes out, and you feed that into a VAE decode (this pack's LTX2TemporalVAEDecode pairs nicely). Under the hood it does a few things the stock sampler doesn't:
- Spatial attention freezing. LTX-2's transformer blocks have two attention paths:
attn1(spatiotemporal self-attention) andattn2(cross-attention to your text). Afterfreeze_ratioof your steps, the node skipsattn1entirely while always runningattn2, so prompt adherence stays intact while the expensive part gets cheaper. Structure converges early in diffusion; the last steps mostly refine motion, which is the idea. - Thermal throttling. It reads real GPU temperature through
pynvmland inserts delays between steps to holdtarget_temp. TheThermal Auto-Scalepreset (the default) adjusts the delay dynamically instead of using a fixed one. - Built-in FlowMatch sigmas. LTX uses flow matching, not plain noise schedules. The node generates LTX-style sigmas internally (
max_shift2.05,base_shift0.95,terminal0.1) and injectsframe_rateinto the conditioning - or you can override it all by wiring anLTXVScheduleroutput into the optionalsigmasinput.
The inputs that actually matter
You don't need to touch most of the 20-odd knobs. The handful worth knowing:
optimization_preset- pick your GPU tier:Quality - Fast (RTX 3080+)down toQuality - Ultra Cool, plusThermal Auto-Scale(default) andCustom. The presets override the manual knobs, so don't fight them.target_temp- default 70°C; drop it toward 60-65 if your card still runs hot.freeze_ratio- how early attention freezing starts (0.3 default). Higher = faster and cheaper, lower = closer to full quality.optimization_engine- extra temporal-attention tricks:Adaptive Cache(default),Token Merge / VidToMe,Step Adaptive, orCombined. These are the "free speed" options; try the default before you go hunting.context_slice_method- LTX-2's dual text encoder (Gemma 3 12B + connector) produces 7680-wide context when the model wants 4096.Keep Last 4096 (Slot 2)is correct for Gemma+LTX Connector.
One honest gotcha before you get excited: the README's optimization table advertises presets with frame_stride 2-8. That's stale. The actual code hard-sets every preset to frame_stride=1 with a comment that says skipping frames breaks temporal coherence in LTX's full temporal attention - the efficiency comes from freezing and throttling, not from frame striding. The frame_stride + interpolation_method (slerp default) controls are still there, but treat frame_stride > 1 as a preview/experiment knob, not the main event. That's also exactly what the pack's separate experimental sampler is for.
Installation
The easiest path is ComfyUI Manager: search "LTX2 Efficient" and install. Manual install works too:
cd ComfyUI/custom_nodes/
git clone https://github.com/kakachiex2/comfyui-ltx2-efficient
cd comfyui-ltx2-efficient
pip install -r requirements.txt
Then restart ComfyUI. Heads-up: the README's manual-install block has a copy-paste slip - it clones a differently-named repo URL. Use the one above. The requirements.txt is just pynvml>=11.5.0, which is optional (it enables thermal auto-scaling; without it the node falls back to fixed throttling with a warning). No model files ship with this pack - you still load your LTX-2 checkpoint, Gemma text encoder, and VAE through ComfyUI-LTXVideo as usual.
Troubleshooting
- "pynvml not installed" warning - expected if you skipped the requirement.
pip install pynvml(ornvidia-ml-py, pynvml is deprecated but works). - Card still runs hot - lower
target_temp, or check that your preset matches your actual GPU. A 3080 preset on a 2060 is asking for trouble. - Flickery or broken motion - if you've set
frame_stride > 1, that's the cause. Set it back to 1 and let the freeze ratio do the work. - Quality issues - the presets in code keep
freeze_ratiomodest andframe_strideat 1, so if something looks off, first suspect your sampler/steps (LTX-2 dev models want ~20 steps, distilled wants ~8 at low CFG) before blaming the node.
It's a small, one-person pack with no big community footprint, so keep expectations realistic - but for a 6GB card trying to run a 19B model, the freezing-plus-throttling approach genuinely does what it says on the tin.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| latent_video | LATENT | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 4.000–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| denoise | FLOAT | 1.000–1 | — |
| optimization_preset | COMBO | Thermal Auto-Scale | 7 options: Quality - Fast (RTX 3080+), Quality - Balanced (RTX 3060/3070), Quality - RTX 2060 6GB, Quality - Cool (RTX 2060 6GB), Quality - Ultra Cool (Low Power GPUs), Thermal Auto-Scale, +1 |
| target_temp | INT | 7050–85 | — |
| frame_stride | INT | 11–32 | Use 1 for best quality |
| attention_window | INT | 41–32 | — |
| freeze_ratio | FLOAT | 0.300–1 | — |
| thermal_throttle | BOOLEAN | true | — |
| interpolation_method | COMBO | slerp | 4 options: linear, slerp, motion, none |
| optimization_engine | COMBO | Adaptive Cache (2-4x speedup) | Temporal attention optimization engine |
| engine_cache_ratio | FLOAT | 0.50–1 | Fraction of later steps to cache (AdaCache) |
| engine_merge_ratio | FLOAT | 0.250–0.5 | Fraction of tokens to merge (TokenMerge) |
| context_slice_method | COMBO | Keep Last 4096 (Slot 2 - LTX Connector) | For Gemma+LTX Connector: use Last 4096. For T5+Gemma: use First 4096. |
| sigmasopt | SIGMAS | Connect LTXVScheduler output here to override internal scheduler | |
| max_shiftopt | FLOAT | 2.050–100 | FlowMatch max shift (same as LTXVScheduler) |
| base_shiftopt | FLOAT | 0.950–100 | FlowMatch base shift (same as LTXVScheduler) |
| terminalopt | FLOAT | 0.100–0.99 | Sigma terminal value after stretching |
| stretchopt | BOOLEAN | true | Stretch sigmas to [terminal, 1] range |
| frame_rateopt | FLOAT | 25.000–1000 | Frame rate for conditioning (same as LTXVConditioning) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |