MiniMax H3 • Low-VRAM Attention Chunking (internal)
The low-VRAM attention knob ComfyUI hides from you
- guider
- guider
- attention_chunk_state
This node is one of the pack's internal helpers, and ComfyUI doesn't even show it in the normal Add Node menu - the display name says "(internal)" and the author means it. So why care? Because when you're trying to push a 33B video model through a GPU with 12 or 16 GB, the thing that kills you first is the attention workspace, not the model weights. Attention Chunking is the wrapper that chops the query side of full attention into pieces so the whole attention matrix never has to exist in VRAM at once.
What it actually does
You feed it a guider and it hands back a new guider with an optimized_attention_override installed into the transformer options. That override runs H3's attention in query chunks of chunk_tokens (default 8192) tokens each. Instead of computing QK^T for the whole long packed sequence in one giant allocation, it processes Q in slices and accumulates the output. Same math, smaller peak. This is the "geometry-aware attention preflight" and "query-chunked attention" the README keeps mentioning, exposed as a node.
The three memory settings matter:
memory_mode-normal/low_vram/ultra_low_vram. This is the envelope the chunking runs under.requested_memory_mode- includesauto, so the runtime can pick an effective profile from the actual model, quantization and sequence geometry instead of trusting what you set.chunk_tokens- the chunk size. Smaller is safer, bigger is faster. 8192 is a sane default; drop toward 4096 or 2048 when you're brushing against OOM.
One genuinely nice bit: it won't silently stomp on an existing optimized_attention_override from another node. If Sage attention or something else already owns that slot, it backs off and records the reason in the attention_chunk_state output instead of breaking your graph.
Outputs
Two outputs: the wrapped guider (wire it into your sampler) and attention_chunk_state, an H3_ATTENTION_CHUNK_STATE object that carries diagnostics - how many calls got chunked, the max sequence length, whether the override actually got installed. The state output is the debugging breadcrumb when you're convinced chunking is active but the memory numbers say otherwise.
Install
It ships in the ComfyUI-MiniMax-H3-LongMedia pack. In ComfyUI Manager search "MiniMax-H3-LongMedia", or:
cd ComfyUI/custom_nodes
git clone https://github.com/vizart-vj/ComfyUI-MiniMax-H3-LongMedia
then restart ComfyUI. No separate Sol attention install needed - the pack embeds its own Sol kernel. You still need the actual H3 checkpoint plus its video and audio VAEs (MiniMaxAI/MiniMax-H3 on HuggingFace, ~42.5 GB of weights), which the H3 Community License locks out of the US, EU, UK and Korea. Check that before you download.
Troubleshooting
The realistic failure is that you wire this in and VRAM doesn't budge. The code is explicit: if another node already installed an optimized_attention_override, this one refuses and logs "another optimized_attention_override is already present." Check the console - that's usually a Sage Attention or a LoRA with baked-in attention patching winning the slot. Also keep ComfyUI's Dynamic VRAM enabled; the pack coordinates with it and explicitly wants you to not launch with --disable-dynamic-vram. And remember you probably don't need this node at all: the Long Media Sampler's attention_mode=auto already routes into chunked attention for long sequences. This wrapper is for when you're building the sampler graph by hand and want the knob in your own hands.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| guider | GUIDER | — | |
| memory_mode | COMBO | normal | 3 options: normal, low_vram, ultra_low_vram |
| requested_memory_mode | COMBO | normal | 4 options: auto, normal, low_vram, ultra_low_vram |
| chunk_tokens | INT | 8192256–65536 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| guider | GUIDER | — |
| attention_chunk_state | H3_ATTENTION_CHUNK_STATE | — |