H3 Memory Optimization
The H3 node that makes a 33B video model fit on your card
- model
- MODEL
H3 Memory Optimization is the workhorse of the H3-Optimizations pack - the node you drop in when MiniMax H3 works but is eating your VRAM alive or crawling. It's a model patch, meaning it sits between the H3 model loader and your sampler and rewrites how the model executes, not what it produces. A 33B model with 42 GB of weights will never be small, but it doesn't have to materialize everything at once, and that's the whole trick.
How it works
Three things happen under the hood. First, QKV projection is chunked: compatible ConvRot INT8 checkpoints stream their projection in 4K-token chunks straight into Comfy Kitchen's INT8 carriers instead of building the full-sequence Q/K/V in memory. Second, MLP layers and the FinalLayer norm/modulation/output projection run in bounded token chunks - the chunk_rows input (default 4096) is your dial for how big each chunk is. Third, on FP8-capable hardware, ordinary BF16/FP16 weights can be converted to FP8 E4M3 for further savings.
That last bit is the one thing worth being careful about. The precision_mode combo defaults to Preserve precision, which forbids new weight quantization entirely - the author's clear preference. Flip it to Allow FP8 conversion and you get extra memory/perf headroom, but FP8 conversion is lossy and can shift output. (The old preserve_precision boolean you'll see on saved workflows is a legacy slot that's ignored now; precision_mode is authoritative.)
The inputs that matter:
fused_qkv(auto/off) - whether chunked QKV projection runs. Auto picks the compatible provider; off forces standard Comfy QKV.mlp_memory(auto/off) - whether MLP gets the bounded-chunk treatment.chunk_rows(256–65536) - larger chunks are faster but use more activation memory. The beginner fix for OOM: lower it.qkv_streaming_mode(Auto/Off/Forced) - Auto preserves an explicit attention selector if one claims the model; Forced lets this node replace dense attention with full-density Kitchen. Leave it on Auto.
The MODEL output feeds straight into your sampler chain, and the node prints a status line telling you which paths actually engaged.
The honest numbers
This node is a memory optimization, not a pure speed hack. The pack's own sweep shows chunked QKV plus bounded MLP adding roughly 7.5% at 5 seconds and 13.3% at 10 seconds - real but modest. The README is refreshingly candid that some of the observed QKV timing win is a CUTLASS config artifact, not magic. Its real job is cutting peak VRAM so the sparse-attention node and long clips fit at all.
Install and gotchas
Install the pack once - Manager search "H3 Optimizations", or git clone https://github.com/Zironic/H3-Optimizations into custom_nodes and restart. No pip dependencies; the native kernels ship prebuilt for Windows x64 and Linux x86-64 (NVIDIA SM80+). Unsupported model families pass through unchanged, so it's safe to leave in the graph. If you see quality drift, check whether Allow FP8 conversion got turned on - that's the first suspect, not the chunking.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| fused_qkv | COMBO | auto | Legacy serialized workflow slot. The value is ignored; QKV streaming is authoritative. |
| mlp_memory | COMBO | auto | auto applies the selected precision policy while retaining bounded MLP chunking. Explicit off remains off. |
| chunk_rows | INT | 4096256–65536 | Maximum token rows processed by one MLP or FinalLayer chunk. Larger chunks may be faster but use more activation memory. The displayed range and step are recommendations; any positive workflow value is accepted. At or above the current input length, the ordinary unsliced MLP runs for that invocation. |
| preserve_precision | BOOLEAN | true | Legacy serialized workflow slot. The value is ignored; Precision mode is authoritative. |
| precision_mode | COMBO | Auto | Auto selects the best compatible native path and may use FP8 conversion as a fallback. BF16 materializes supported weights as BF16. Preserve native never introduces a new conversion. Force quant keeps supported quantized checkpoints native and converts floating H3 linears to execution-scoped ConvRot-256 INT8. |
| qkv_streaming_mode | COMBO | Auto | Off prevents this node from replacing existing dense attention and disables QKV streaming, including carriers requested by H3 Sparse Attention. Auto preserves Sage, Comfy Kitchen, or ComfyUI's normal attention selection and adds a compatible bounded carrier; unknown overrides keep their full-Q single-call contract. Forced explicitly allows this node to replace dense attention with full-density Kitchen. H3 Sparse Attention remains authoritative. |
| embedding_memory_mode | COMBO | Auto | Legacy serialized workflow slot. The value is ignored; compatible embedding assembly tensors are released early, otherwise ComfyUI's stock lifetime is preserved. |
| kitchen_v_memory_mode | COMBO | Standard | Standard prioritizes speed. Lower VRAM uses additional attention work to reduce peak memory. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |