Nodes/ComfyUI-UtilsCollection/MiniMax H3 SLA Attention Config
ComfyUI Node

MiniMax H3 SLA Attention Config

The dials for the pack's experimental sparse-attention speedup

By silveroxides·Created 3 months ago·Updated 3 days ago· 35
MiniMax H3 SLA Attention Config
    • SLA Config
    minimum_sequence_length8192
    dense_steps0
    protect_audiotrue
    disable_fp16_accumulationtrue
    stabilize_routingfalse

    MiniMax H3 is the 33B omni-modal video model - text, image, video and audio in one context - and the honest truth on consumer hardware is that it's slow. A few seconds of clip means attention over a lot of tokens, and that attention is where local generation grinds. SLA stands for sparse attention with block-level selection: instead of computing attention against every past key block, a router skips roughly 90% of them per query and only attends to the ones that matter. Less work per step, faster wall-clock time.

    This node doesn't do any of that work itself. It's a config object - a bundle of five settings you connect into the pack's UC_UnifiedAttentionPatcher to fine-tune how SLA behaves. The patcher carries the coarse levers (sparsity, block_size, dense_tail_steps, protect_reference_media, dense_backend); this node is where you dial in the edge cases: short sequences, specific sampling steps, audio, and numerical stability.

    When you'd reach for it

    If you're running H3 locally at all - remember the weights are ~42.5 GB and geofenced out of the US, EU, UK and South Korea by the Community License, which is a separate problem from how many seconds each clip takes - attention speed is the thing that separates "prototype" from "usable". Sparse attention is experimental and only patches MiniMax H3 self-attention (128-dim heads, CUDA + Triton required), but when it applies it's the biggest single lever in this pack for cutting generation time. It doesn't touch ComfyUI Core files or the model weights, and it never breaks the model: if a call can't go sparse for any reason, it falls back to dense and logs why once in the console.

    The inputs

    Everything defaults to sensible and most people should leave them alone until they've compared sparse vs. dense output:

    • minimum_sequence_length (default 8192) - sequences below this length keep the existing dense path. Short clips barely benefit from sparsity anyway, and this stops SLA from kicking in before a context is long enough to matter.
    • dense_steps (default "0") - sampling steps forced dense, zero-based, comma-separated with - ranges supported (0,3-5). Keeping the first step dense is the default for a reason: it sets the composition everything after refines. Add final steps here (or on the patcher's dense_tail_steps) when the tail of generation looks rougher than it should.
    • protect_audio (default on) - H3 generates audio natively, in the same context. This keeps text and audio token ranges in every sparse selection so you don't silently wreck the soundtrack chasing speed. Leave it on.
    • disable_fp16_accumulation (default on) - forces full-precision accumulation for the sparse matmuls during the SLA run. Costs a little speed, buys a lot of numerical stability; turn it off only if you've benchmarked and your output is clean.
    • stabilize_routing (default off) - biases near-cutoff block selection toward the previous sampling step. Enable it only if you see unstable, flickering motion detail that sparsity introduced.

    Output and wiring

    Output is a single SLA Config object. Plug it into UC_UnifiedAttentionPatcher's optional minimax_h3_sla_config input with the patcher set to Sparse / MiniMax H3 SLA; omit it and the patcher just uses its own defaults. Everything downstream is the patcher's job.

    Install and gotchas

    Same install as the whole pack - ComfyUI Manager (search ComfyUI-UtilsCollection) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
    

    Restart, and you're done. SLA downloads nothing itself; the only requirement is CUDA and Triton, so on CPU or Apple silicon there's simply no acceleration here. Where people trip up:

    • Expect less speedup than the sparsity number suggests. Masked attention calls, non-H3 attention, unsupported dtypes, short sequences, and any configured dense step all stay dense. The console reports each reason once per run, so glance at the log before you assume it's working.
    • A sparse-kernel failure disables sparse for the rest of that run and silently (well, log-only) keeps the model usable on dense attention.
    • It only patches MiniMax H3. Point it at another model and you'll get an error rather than a silent no-op - that's a feature.
    • It's experimental. Compare sparse against dense output for your model, resolution, duration and sampler before you trust it on anything you care about. Defaults are a starting point, not a verdict.

    Start at the defaults, watch the console for fallback reasons, and only start touching stabilize_routing and dense_steps if the motion detail starts misbehaving.

    Categoryadvanced/model/patches

    Inputs (5)

    NameTypeDefaultDescription
    minimum_sequence_lengthINT81920–1000000Sequences below this length keep the existing dense attention path.
    dense_stepsSTRING0Comma-separated zero-based sampling steps or inclusive ranges kept dense, for example 0,3-5.
    protect_audioBOOLEANtrueKeep text and audio token ranges in every sparse attention selection.
    disable_fp16_accumulationBOOLEANtrueDisable FP16 and BF16 reduced-precision matmul accumulation for this SLA sampling run.
    stabilize_routingBOOLEANfalseBias near-cutoff routing toward the prior sampling step to reduce unstable motion detail.

    Outputs (1)

    NameTypeDescription
    SLA ConfigMINIMAX_H3_SLA_ATTENTION_CONFIGConnect to Unified Attention Patcher when using Sparse / MiniMax H3 SLA.