Nodes/comfyui-ltx2-efficient/LTX2 Efficient Video Sampler
ComfyUI Node

LTX2 Efficient Video Sampler

Keeping LTX-2 alive on a 6GB card

By kakachiex2·Created 8 months ago·Updated 7 months ago· 10
LTX2 Efficient Video Sampler
  • model
  • latent_video
  • positive
  • negative
  • sigmas
  • LATENT
seed0
steps20
cfg4.00
sampler_name
denoise1.00
optimization_presetThermal Auto-Scale
target_temp70
frame_stride1
attention_window4
freeze_ratio0.30
thermal_throttletrue
interpolation_methodslerp
optimization_engineAdaptive Cache (2-4x speedup)
engine_cache_ratio0.5
engine_merge_ratio0.25
context_slice_methodKeep Last 4096 (Slot 2 - LTX Connector)
max_shift2.05
base_shift0.95
terminal0.10
stretchtrue
frame_rate25.00

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) and attn2 (cross-attention to your text). After freeze_ratio of your steps, the node skips attn1 entirely while always running attn2, 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 pynvml and inserts delays between steps to hold target_temp. The Thermal Auto-Scale preset (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_shift 2.05, base_shift 0.95, terminal 0.1) and injects frame_rate into the conditioning - or you can override it all by wiring an LTXVScheduler output into the optional sigmas input.

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 to Quality - Ultra Cool, plus Thermal Auto-Scale (default) and Custom. 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, or Combined. 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 (or nvidia-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_ratio modest and frame_stride at 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.

Categoryvideo/ltx2

Inputs (26)

NameTypeDefaultDescription
modelMODEL
latent_videoLATENT
positiveCONDITIONING
negativeCONDITIONING
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT4.000–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
denoiseFLOAT1.000–1
optimization_presetCOMBOThermal Auto-Scale7 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_tempINT7050–85
frame_strideINT11–32Use 1 for best quality
attention_windowINT41–32
freeze_ratioFLOAT0.300–1
thermal_throttleBOOLEANtrue
interpolation_methodCOMBOslerp4 options: linear, slerp, motion, none
optimization_engineCOMBOAdaptive Cache (2-4x speedup)Temporal attention optimization engine
engine_cache_ratioFLOAT0.50–1Fraction of later steps to cache (AdaCache)
engine_merge_ratioFLOAT0.250–0.5Fraction of tokens to merge (TokenMerge)
context_slice_methodCOMBOKeep Last 4096 (Slot 2 - LTX Connector)For Gemma+LTX Connector: use Last 4096. For T5+Gemma: use First 4096.
sigmasoptSIGMASConnect LTXVScheduler output here to override internal scheduler
max_shiftoptFLOAT2.050–100FlowMatch max shift (same as LTXVScheduler)
base_shiftoptFLOAT0.950–100FlowMatch base shift (same as LTXVScheduler)
terminaloptFLOAT0.100–0.99Sigma terminal value after stretching
stretchoptBOOLEANtrueStretch sigmas to [terminal, 1] range
frame_rateoptFLOAT25.000–1000Frame rate for conditioning (same as LTXVConditioning)

Outputs (1)

NameTypeDescription
LATENTLATENT