Configure SLA Sparse Attention
Configure SLA Sparse Attention
- model
- model
If Configure Sol Sparse Attention is the "skip what the model probably doesn't care about" node, SLA is its stricter sibling with a fixed budget and one very specific boss: MiniMax H3. Configure SLA Sparse Attention implements the H3 Turbo-SLA runtime - a fixed-budget Top-K router where every 128-token query block keeps exactly the top-K of the 64-token K/V blocks and skips the rest. No statistical threshold to tune, no local blocks, no skipped-block residual; Sol's extras are deliberately absent. What it does instead is reproduce the exact sparsity the model was trained with, and that's the whole trick: SLA (Sparse Linear Attention) is baked into H3's Turbo runtime, so the weights already expect this routing. You're not approximating a dense model - you're running it the way it was born.
How it works
The one knob that matters is sparsity_ratio, default 0.85 - the fraction of 64-token K/V blocks skipped for each 128-token query block, and the published MiniMax H3 Turbo-SLA training/runtime hyperparameter. Use it with the SLA-trained LoRA. Set it to zero and the node dispatches straight to the dense backend. Below the hood it shares Sol's good manners: the three reference-protection switches, dense step/layer scheduling, fused Q/K preprocessing, and the inherited W8A8/FP16 numeric path all carry over, so your keyframes, reference images, and dialogue stay exact unless you flip them.
H3 is MiniMax's 33B omni-modal video model - unified text/image/video/audio context, native stereo audio, the one with the day-zero ComfyUI support. It's also the one whose community licence geofences the weights out of the US, EU, UK and South Korea. That's a model-side gate, not a node problem: if you can't legally run the weights, no patch node fixes it.
The inputs that matter
- sparsity_ratio -
0.85for H3 Turbo-SLA. That's the whole recipe. Higher skips more and risks artifacts; the model wasn't trained for it. - dense_prefix_steps / dense_suffix_steps - both default
0, which reproduces all-step SLA routing. Set them if you want the first or last denoising steps run fully dense. - sparse_reference_image / _video / _audio -
false,true,falseby default. Long reference-video blocks route sparsely; reference images and audio conditioning stay exact. Audio defaults to protected because that's where dialogue lives - flip it only if you know why. - prefix_policy / manual_prefix_tokens -
autouses H3's own semantic layout;manualprotects a leading token count.
The single model output feeds your sampler, exactly like Sol's.
Installing it
Same pack, same steps - this is the second node of ComfyUI Turing Utils (https://github.com/wjie98/comfyui-svdint4):
cd ComfyUI/custom_nodes
git clone https://github.com/wjie98/comfyui-svdint4
cd comfyui-svdint4
python -m pip install -v --no-build-isolation -e ./kernel
The custom node itself is Python-only, but the SLA kernel needs the comfyui-turing-utils-kernel package built (≥0.29.1), and the build is never automatic: requirements.txt intentionally leaves it out so ComfyUI Manager won't trigger a CUDA compile you didn't ask for. The kernel builds for every GPU it can see at install time, with COMFYUI_TURING_UTILS_ARCH_LIST as the override. Requirements are the pack-wide ones: a CUDA NVIDIA GPU (Turing/Ampere/Ada or newer), Python 3.10+, PyTorch with CUDA.
Troubleshooting
- Wrong model. This is the H3 node. If you're not running MiniMax H3 with the SLA-trained LoRA, Sol is the general-purpose sibling you actually want - SLA's fixed Top-K doesn't adapt to content the way Sol's statistical threshold does.
- No speedup, silently. Same failure as every node in this pack: kernel not built, or the model didn't come through the ConvRot loader, so the integer path falls back to SDPA. Pair it with Load ConvRot DiT and confirm the kernel wheel actually installed.
- Artifacts after cranking the ratio. Don't.
0.85matches the training hyperparameter; pushing toward0.99spends a budget the weights were never trained against, and the artifacts show up exactly where the routing guesses wrong. - Legacy node confusion. The old Patch SLA Sparse Attention still exists so saved workflows keep their positional widgets; new graphs should use this Configure node.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| sparsity_ratio | FLOAT | 0.850–0.99 | Fraction of 64-token K/V blocks skipped for every 128-token Query block. 0.85 matches the public MiniMax H3 Turbo-SLA training/runtime hyperparameter and should be used with an SLA-trained LoRA. Zero dispatches directly to the dense backend. |
| prefix_policy | COMBO | auto | Auto applies the H3 semantic layout and reference switches. None reproduces the unprotected published SLA route. Manual protects only the leading token count. |
| manual_prefix_tokens | INT | 00–262144 | Leading Query tokens kept dense and leading K/V tokens kept exact for manual policy. |
| sparse_reference_image | BOOLEAN | false | Allow image-reference and keyframe blocks to use SLA Top-K routing. Disabled keeps their Query dense and KV exact. |
| sparse_reference_video | BOOLEAN | true | Allow long reference-video blocks to use SLA Top-K routing. |
| sparse_reference_audio | BOOLEAN | false | Allow reference-audio blocks to use SLA Top-K routing. Disabled protects dialogue conditioning exactly. |
| dense_prefix_steps | INT | 00–1000 | Leading steps of every sampler invocation that use the loader-selected dense backend across every transformer layer. |
| dense_suffix_steps | INT | 00–1000 | Trailing steps of every sampler invocation that use the loader-selected dense backend across every transformer layer. |
| dense_prefix_layers | INT | 00–256 | Leading transformer layers kept on the loader-selected dense backend during sparse steps. |
| dense_suffix_layers | INT | 00–256 | Trailing transformer layers kept on the loader-selected dense backend during sparse steps. |
| debug_route_densityopt | BOOLEAN | false | Log realized SLA route density, including exact reference blocks. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |