KJNodes/ltxvgenerated

LTX2 Mem Eff Sage Attention Patch(LTX2MemoryEfficientSageAttentionPatch)

EXPERIMENTAL! Activates custom sageattention to reduce peak VRAM usage, overrides the attention mode. Requires latest sageattention version.

LTX2 Memory Efficient Sage Attention Patch

model
model
triton_kernels
KJNodes

Description

EXPERIMENTAL! This node activates a custom sageattention patch to reduce peak VRAM usage. It overrides the current attention mode in the model, replacing it with memory-efficient sageattention kernels. Requires the latest version of the sageattention library.

Inputs

  • model (MODEL, required)
    The diffusion model to which the memory-efficient attention patch will be applied.

  • triton_kernels (BOOLEAN, required, default: true)
    When enabled, uses Triton fused RoPE kernels for the self-attention Q/K projections. This can further reduce memory and improve performance but requires Triton to be installed.

Outputs

  • MODEL
    The same model with its attention mode patched to use sageattention, ready for inference with lower VRAM usage.

Usage Notes

  • This node is experimental — behavior may change in future versions.
  • Ensure you have the latest sageattention package installed (e.g., pip install sageattention --upgrade).
  • Enabling triton_kernels requires Triton to be available in your environment. If Triton is not installed, set this input to false.
  • The patch overrides the model's built-in attention mechanism; it will affect all attention layers in the model.
  • Typically used in combination with LTX2‑family workflows to reduce VRAM peaks during sampling.

Comments

Sign in with GitHub to join the discussion.

Loading comments…
LTX2 Mem Eff Sage Attention Patch (LTX2MemoryEfficientSageAttentionPatch) - ComfyUI-KJNodes | ComfyUI Wiki