MiniMax H3 Mem Eff Sage Attention Patch
The H3 memory patch that needs one extra install
- model
- model
Of all the MiniMax H3 VRAM helpers in KJNodes, this is the one with an asterisk. It's also the one that hits the hardest: it replaces the H3 self-attention with custom sageattention kernels that quantize q/k to int8, keep the accumulator in fp32, and shrink the attention working set dramatically. The node description says it outright - EXPERIMENTAL! and "requires latest sageattention version." That's kijai being honest about both the payoff and the dependency.
This is the node you reach for when plain attention is what's OOMing you. On the packed token streams H3 runs, attention is a huge chunk of the VRAM bill, and sageattention's int8 path is the community's standard answer to it.
How it works
The patch overrides the attention mode - by design. It rewrites every transformer block's attn.forward to a fused path: one GEMM produces q/k/v, then an in-place fused RMSNorm plus split-half RoPE runs on the qkv buffer via ComfyUI's own quantized kernels, then the int8/fp8 sageattention kernel takes over. Buffers get freed the moment they're consumed instead of lingering. It also composes cleanly with MiniMax Low VRAM Attention: if both nodes are in the graph, the attention patch reads the head_chunks setting from the other node and honors it.
A single model in, a patched model out. That's the whole schema - there's nothing to tune, which is rare and refreshing for a memory patch.
Installing it
Two parts. First the pack itself, via ComfyUI Manager (search "KJNodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-KJNodes
cd ComfyUI-KJNodes
pip install -r requirements.txt
Then the actual dependency, which the pack deliberately does not bundle:
pip install -U sageattention
"Latest" is load-bearing - the node probes for very recent sageattention internals and CUDA architecture detection, and an old version fails the check. You also need a ComfyUI build with native MiniMax H3 support (comfy.ldm.minimax), and it's NVIDIA/CUDA only: the kernels are arch-specific and the node refuses to apply without a detectable CUDA arch.
Troubleshooting
This is the one H3 node that fails loud instead of warning and carrying on. Two errors to know:
- "sageattention is not new enough version or could not determine CUDA architecture" - update sageattention, confirm you're on a recent ComfyUI, and make sure you're actually on an NVIDIA GPU with supported arch (sm80+).
- "can only be applied to a MiniMax H3 model" - you fed it the wrong model. It won't silently no-op; it'll tell you.
If you're on AMD, this node is a dead end - use MiniMax Low VRAM Attention instead, which needs no extra install and is math-identical. And if it still OOMs after the patch, the feedforward is probably your bottleneck now, which is exactly what MiniMax H3 Chunk FeedForward is for.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |