沐阳 H3 · 条件前显存屏障(内部)
The barrier that runs before conditioning, not after
- h3
- loaded_model
- h3
Most memory nodes in ComfyUI are about what happens after something: sample, then clean up. This one is about before, and it exists because of a scheduling subtlety that makes "before" harder than it sounds.
Here's the shape of the problem. The long-video node receives a MODEL input. ComfyUI is free to keep that model loaded from a previous queue, or to stage it while the dynamic graph is being expanded - and there's nothing in the graph saying "not yet." So when the reference conditioning starts, several gigabytes of DiT weights are sitting on the card, and the reference VAE has to fit beside them. On a 16GB device that OOMs before pass 1 has sampled a single step.
What it does
Two required inputs, one optional, one output:
h3(MYANG_H3) - the pack's bundle for the job. It goes in and comes back out.stage(STRING, defaultsampling model -> conditioning) - a label for the log line, so you can tell which barrier fired in a long run.loaded_model(MODEL, optional) - the clever bit, and it's worth a second look because it's deliberately not returned. Wire the model here and the node uses it to preserve that model's host cache while evicting everything else. The value itself doesn't come out the other side; it's a scheduling edge. It exists so the cleanup cannot possibly run before the upstream MODEL node has finished and registered its residency. Without the wire, ComfyUI could schedule the release first and free a model that hadn't loaded yet - cleanup that does nothing, at the exact moment it was supposed to help.
Output: h3, the same bundle. The MODEL is loaded normally later, when the guider samples.
One more flag matters: this barrier preserves the dynamic host cache while it evicts. The pack's own commentary explains why - the blunt unload_all_models path also truncates pinned host buffers to zero, so the next stage re-stages the whole DiT from disk instead of from RAM. That's the difference between a pause and a reboot of your patience. On a 33B video model it's the difference between seconds and minutes.
Like its siblings, the node forces itself to re-run every queue. Cleanup is a side effect, side effects don't survive caching, so it declares itself always-changed. If you're writing your own barriers, that idiom is not optional - the node plumbing layer explains the NaN trick and its footgun.
Four barriers, four jobs
They're easy to confuse, so here's the set:
| Node | Guards |
|---|---|
| This one | stale DiT residency before reference/CLIP/VAE conditioning |
| H3ConditionMemoryBarrier | CLIP/VAE after conditioning, before pass 1 |
| H3RefineMemoryBarrier | pass-1/VAE/upscaler residency before the pass-2 model loads |
| H3OutputMemoryRelease | everything, once the finished output exists |
Category 沐阳 H3/内部 on all of them. In a Director or long-video-expansion graph they're already wired; you don't add them yourself.
Why you might care
Diagnostics, mostly. When an H3 job dies, where it dies tells you which of these to look at. Dying during conditioning - reference images, prompts, VAE encode - points at this barrier. Dying right after is the condition barrier's territory. Dying at pass-2 step zero is the refine barrier's.
There's also a practical note in the pack's README worth repeating: on 16GB Windows cards the automatic memory profile evicts pass-1, VAE and upscaler residency before the pass-2 model loads, and retries once after a real OOM. A run that OOMs and then succeeds is the system doing its job, not a sign your card is too small.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/civilcoco/ComfyUI-MiniMaxH3-Myang
Restart ComfyUI and hard-refresh the browser; category 沐阳 H3/内部. The pack declares no Python dependencies - this node calls into ComfyUI's own model_management layer.
You'll still need your own H3 diffusion model, Qwen text encoder, video VAE and audio VAE. And if you're chasing an OOM, change one thing at a time: the pack's advice to troubleshoot against a plain two-segment baseline exists because Turbo, cache nodes, attention patches and second-pass processing all shift speed, memory and quality at once. Troubleshooting for the general patterns.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| h3 | MYANG_H3 | — | |
| stage | STRING | sampling model -> conditioning | — |
| loaded_modelopt | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| h3 | MYANG_H3 | — |