ComfyUI Node
Patch SLA Sparse Attention
A ComfyUI node in Turing Utils/patches with 13 inputs and 1 output.
Patch SLA Sparse Attention
- model
- model
◄sparsity_ratio0.85►
◄prefix_policyauto►
◄manual_prefix_tokens0►
◄sparse_reference_imagefalse►
◄sparse_reference_videotrue►
◄sparse_reference_audiofalse►
◄dense_prefix_steps0►
◄dense_suffix_steps0►
◄dense_prefix_layers0►
◄dense_suffix_layers0►
◄use_w8a8true►
◄debug_route_densityfalse►
CategoryTuring Utils/patches
Inputs (13)
| 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 | Early denoising steps that use the selected dense backend in every layer. Set 0 to reproduce all-step SLA routing. |
| dense_suffix_steps | INT | 00–1000 | Final denoising steps that use the selected dense backend in every layer. |
| dense_prefix_layers | INT | 00–256 | Leading transformer layers kept dense in sparse steps. Prefix plus suffix reaching the model layer count makes the complete patch dense. |
| dense_suffix_layers | INT | 00–256 | Trailing transformer layers kept dense in sparse steps. |
| use_w8a8opt | BOOLEAN | true | Use INT8 V and probability Tensor Cores for selected SLA blocks and protected dense steps/layers. |
| debug_route_densityopt | BOOLEAN | false | Log realized SLA route density, including exact reference blocks. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |