Nodes/ComfyUI-LTXVideo/LTX Attention Bank
ComfyUI Node Runs on cloud

LTX Attention Bank

Stash attention during inversion to keep edits consistent

By Lightricks·Created 2 years ago·Updated about a month ago· 3,956
LTX Attention Bank
    • ATTN_BANK
    save_steps0
    blocks

    LTXAttentionBank is a memory jar for attention. It's part of the "ltxtricks" family - the nodes ported from Logtd's community ComfyUI-LTXTricks, which brought RF-inversion-style video editing to LTX - and its purpose is to record the model's attention from selected transformer blocks during one pass so you can reinject it during another. That sharing is what lets you edit an existing clip while keeping its structure and identity intact instead of the model reinventing everything.

    If you're doing the invert-then-regenerate editing dance (turn a real video into noise, then denoise it toward a new prompt), the danger is drift: the output wanders away from the source. Banking attention on the way in and injecting it on the way out anchors the edit. It's the same lineage of idea as prompt-to-prompt and attention-injection editing, adapted to LTX's video transformer.

    How it works

    During the forward/inversion pass, the node captures the attention maps produced by the transformer blocks you name, at the steps you choose, and stores them in an ATTN_BANK. That bank then travels to the reverse sampler, which injects the stored attention back in so the regenerated video reuses the original's spatial and temporal relationships. You're essentially telling the model, "keep looking at things the way the source did, but change what I asked you to change."

    The inputs and outputs that matter

    • save_steps (INT, default 0, range 0–1000) - how many sampling steps' worth of attention to bank. 0 means it saves nothing, so if the bank feels empty, this is the first thing to raise. Bank more steps for a stronger anchor to the source, fewer for more freedom to change.
    • blocks (STRING, multiline) - which transformer blocks to record from, one per line. Different blocks hold different information, so this is where you decide whether you're preserving coarse structure, fine detail, or both. It pairs naturally with LTXAttnOverride for choosing targets.

    Output is an ATTN_BANK that feeds into LTXRFForwardODESampler's attn_bank input (and the reverse sampler consumes the injected version).

    How to install it

    Use ComfyUI Manager as the README suggests - Ctrl+M, Install Custom Nodes, search LTXVideo, install, restart. Manual install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Lightricks/ComfyUI-LTXVideo
    

    then restart ComfyUI. It appears under the ltxtricks menu. No dedicated downloads, but the editing pipeline it belongs to runs on the LTX video model (32GB+ VRAM, 100GB+ disk per Lightricks).

    Common issues & troubleshooting

    The bank appears to do nothing. Check save_steps - at the default of 0 it records no attention. Give it a real number of steps and make sure blocks names actual blocks.

    VRAM spikes or OOM. Banking attention means holding extra tensors in memory across passes; the more steps and blocks you save, the more you store. On a tight card that can tip you over, and LTX-2 is already famously VRAM-hungry thanks to its big DiT and the Gemma text encoder. Bank fewer steps or fewer blocks if you're running out.

    The edit ignores your changes / stays too close to the source. You're over-anchoring. Reduce save_steps or bank from fewer blocks so the model has room to apply the new prompt. It's a balance: too little banking and the edit drifts, too much and nothing changes.

    This is deep-end territory. If you've never run RF-inversion on LTX before, start from a working ltxtricks example graph rather than wiring the forward sampler, attention bank, and reverse sampler from scratch - the interplay between them is where all the subtlety lives.

    Categoryltxtricks

    Inputs (2)

    NameTypeDefaultDescription
    save_stepsINT00–1000
    blocksSTRING

    Outputs (1)

    NameTypeDescription
    ATTN_BANKATTN_BANK