Nodes/comfyui-svdint4/Patch SLA Sparse Attention
ComfyUI Node

Patch SLA Sparse Attention

A ComfyUI node in Turing Utils/patches with 13 inputs and 1 output.

By wjie98·Created 2 months ago·Updated about 15 hours ago· 2
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)

NameTypeDefaultDescription
modelMODEL
sparsity_ratioFLOAT0.850–0.99Fraction 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_policyCOMBOautoAuto applies the H3 semantic layout and reference switches. None reproduces the unprotected published SLA route. Manual protects only the leading token count.
manual_prefix_tokensINT00–262144Leading Query tokens kept dense and leading K/V tokens kept exact for manual policy.
sparse_reference_imageBOOLEANfalseAllow image-reference and keyframe blocks to use SLA Top-K routing. Disabled keeps their Query dense and KV exact.
sparse_reference_videoBOOLEANtrueAllow long reference-video blocks to use SLA Top-K routing.
sparse_reference_audioBOOLEANfalseAllow reference-audio blocks to use SLA Top-K routing. Disabled protects dialogue conditioning exactly.
dense_prefix_stepsINT00–1000Early denoising steps that use the selected dense backend in every layer. Set 0 to reproduce all-step SLA routing.
dense_suffix_stepsINT00–1000Final denoising steps that use the selected dense backend in every layer.
dense_prefix_layersINT00–256Leading transformer layers kept dense in sparse steps. Prefix plus suffix reaching the model layer count makes the complete patch dense.
dense_suffix_layersINT00–256Trailing transformer layers kept dense in sparse steps.
use_w8a8optBOOLEANtrueUse INT8 V and probability Tensor Cores for selected SLA blocks and protected dense steps/layers.
debug_route_densityoptBOOLEANfalseLog realized SLA route density, including exact reference blocks.

Outputs (1)

NameTypeDescription
modelMODEL