MiniMaxH3LatentLabUltraPinnedMemoryGate
Turning off pinned memory so the huge H3 model can page itself
- guider
- guider
- previous_disable_pinned_memory
MiniMax H3 is a 33B model, and when it's bigger than your VRAM it has to stream weights on and off the GPU as it runs. That's where "pinned memory" becomes a problem. ComfyUI can pin host buffers so transfers are faster - but on tight systems, especially Windows with AIMDO, pinning can exhaust host mappings and blow up mid-sampling with something like a GetOverlappedResult error 1450. The fix is to run with --disable-pinned-memory, but you don't want to relaunch ComfyUI just to flip a flag for one long clip.
MiniMaxH3LatentLabUltraPinnedMemoryGate does it for you, mid-workflow. You feed it a guider (GUIDER) and an enable switch (default true). While enabled, it mirrors --disable-pinned-memory, unpins any already-pinned model weights, and soft-empties the CUDA cache before the first weight fault - which is the exact spot where the failure used to happen. The guider passes through untouched, and you also get a previous_disable_pinned_memory BOOLEAN that records what ComfyUI's setting was before the node touched it.
Why it's a pair, not a single node
The Gate is deliberately temporary. It flips a global ComfyUI setting, and flipping globals without putting them back is how you end up with a confusingly slow or broken ComfyUI an hour later. That's why the companion UltraPinnedMemoryRestore node exists: you feed it the previous_disable_pinned_memory value the Gate emitted, and it restores the original setting after sampling. Gate → sample → Restore is the full circuit. If you're using the pack's public Long Media Sampler, this plumbing is handled for you under the ultra_low_vram memory mode - these two nodes surface when you're hand-wiring a workflow or diagnosing a run that died on pinned host buffers.
Inputs and outputs
guider(GUIDER) - passes straight through; the node only patches the runtime's CLI flag.enable(BOOLEAN, default true) - set false to leave ComfyUI's pinned-memory setting alone.- Outputs:
guiderandprevious_disable_pinned_memory(BOOLEAN - wire this into the Restore node).
Install
Part of the single pack, no extra pip dependencies:
cd ComfyUI/custom_nodes
git clone https://github.com/vizart-vj/ComfyUI-MiniMax-H3-LongMedia
Restart ComfyUI, or install via ComfyUI Manager ("MiniMax H3 LongMedia"). The H3 checkpoint and VAEs go in ComfyUI's normal model folders.
Gotchas
- Don't leave a Gate wired without its Restore. The whole point of the pair is to put ComfyUI back the way it found it.
- The node silently skips if it can't reach the CLI args - so if your ComfyUI version changed the flag location, the Gate does nothing and you should see that in the console rather than assume it's active.
- Pack-wide reminder: the H3 open weights are excluded from the US, EU, UK and South Korea under the MiniMax H3 Community License.
It's plumbing, not a creative tool - but if you've ever watched a long H3 run die at the first weight load, you know exactly why this exists.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| guider | GUIDER | — | |
| enable | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| guider | GUIDER | — |
| previous_disable_pinned_memory | BOOLEAN | — |