Nodes/MiniMax H3/MiniMax H3 Attention Config
ComfyUI Node

MiniMax H3 Attention Config

MiniMax H3 Attention Config — mostly a 'don't touch it' node, until your card demands one

By xiaolibai-sys·Created about a month ago·Updated 29 days ago· 10
MiniMax H3 Attention Config
    • attention_config
    backendsageattn2
    force_backendfalse

    This is the node you only reach for when something's wrong. MiniMax H3's transformer blocks are compute-heavy, and which attention kernel runs under them decides whether your card melts or hums along. The Attention Config node picks that kernel - and, in practice, the auto fallback does such a good job that this node mostly exists for the day your GPU is the one with the weird gap in its kernel support.

    How it works

    Every attention backend is a different piece of C/CUDA code for the same math. SageAttention is the current winner for video-scale models - its INT8/FP16 mixed kernels are dramatically faster than stock PyTorch attention on Blackwell and Ada - but not everyone has it, and not every card supports every Sage version. So this node doesn't just set a backend, it hands the loader a config with a fallback chain. Wire it into the MiniMaxH3Loader's attn_backend socket and the loader will try, in order: SageAttention3 (Blackwell) → SageAttention2/1 → FlashAttention → SDPA-flash (torch) → xformers → SDPA → SDPA-math. That last one is the eager fallback that works on literally anything - slow, but it always runs.

    That's the whole design trick: you pick where in the chain you want to start, and unless you flip force_backend, the code quietly walks down until it finds something your GPU can actually run. No error spam, no failed workflow because your card is two architectures behind the author's.

    The inputs that matter

    • backend - dropdown: auto, sageattn2, sageattn1, xformers, sdpa, sdpa_math. The default is sageattn2 when it's available, else auto. Leave it alone unless you're debugging. If your card is Blackwell, auto will prefer Sage3 for you.
    • force_backend - default False, and this is the dangerous one. True means "use exactly what I selected or fail" - no fallback. Only for when you genuinely need to pin a specific kernel (e.g. reproducing someone's exact speed comparison). Leave it off.

    One output: attention_config, a MINIMAX_H3_ATTN, into the Loader's attn_backend socket. If you don't wire this node at all, the Loader defaults to sageattn2, so the entire pack works fine with zero Attention Config nodes in your graph.

    Installing it

    Same as every node in this pack - ComfyUI Manager search "MiniMax H3", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xiaolibai-sys/ComfyUI-MiniMaxH3
    pip install -r requirements.txt
    

    then restart. Dependencies are light - torch, safetensors, numpy. One honest caveat: SageAttention kernels are not installed by this pack's requirements. If you want the fast Sage path you install sageattention yourself (it's a separate pip package with its own CUDA requirements); without it, auto just falls through to whatever torch/flash-attn you already have, and the node still works - just slower.

    Common issues

    • "Backend not available" even with auto. That's what force_backend=True does. Set it back to False.
    • Slow but working. You're running on SDPA-math or xformers because Sage isn't installed. Install sageattention for your CUDA version, or accept the fallback - the node told you the truth about your hardware.
    • Can't find the node in the menu. It lives under MiniMax-H3 → loaders. You generally don't need it in the graph, so don't go hunting for it unless a sampler is failing or suspiciously slow.
    CategoryMiniMax-H3/loaders

    Inputs (2)

    NameTypeDefaultDescription
    backendCOMBOsageattn2Attention backend. auto selects the best available backend: Sage3 -> Sage2/1 -> FlashAttn -> SDPA-flash(torch) -> xformers -> SDPA -> SDPA-math
    force_backendBOOLEANfalseForce the selected backend instead of falling back.

    Outputs (1)

    NameTypeDescription
    attention_configMINIMAX_H3_ATTN