Mpi Clear Vram
The 'I've been running video models all day' button
- passthrough
- passthrough
Video models and big checkpoints have a habit of leaving your GPU in a state where the next generation barely fits in VRAM - or doesn't at all. Mpi Clear VRAM is the "shut it all down and start fresh" button, as a node in your graph. It offloads every loaded model from VRAM back to RAM, empties the GPU cache, and runs garbage collection. Models get reloaded automatically the next time they're needed, so nothing breaks - the GPU just gets its head clear.
The mechanism is a straight call into ComfyUI's own model management, which is the right tool for the job and the reason this is safe rather than scary. The source does: gc.collect() to sweep Python garbage, comfy.model_management.unload_all_models() to push models out of VRAM, soft_empty_cache() to let ComfyUI's cache go, and - on CUDA systems - torch.cuda.empty_cache() plus torch.cuda.ipc_collect() to hand freed memory back to the driver. "Offload to RAM" is the key word: the models aren't deleted, so the next run loads them straight back from memory instead of from disk. That's the difference between this and a hard process restart - it's fast to recover, and you don't lose your queue.
Inputs and outputs are about as minimal as a node gets: an optional passthrough input (wildcard *) and a matching passthrough output. It's marked as an output node, and the pass-through exists so you can wire it inline in a chain without breaking the flow - drop it on a wire, it clears VRAM and carries the value onward. The value is entirely incidental; the real output is an empty GPU.
Where you'd actually use it: the classic spot is between big jobs in a multi-stage pipeline - after a heavy video generation, before the next one - so each stage starts with a clean GPU rather than inheriting the previous stage's resident models. It's also the natural home for "I've been iterating for hours and VRAM is a mess": run the graph once with this node in it (or trigger it directly) and the GPU resets. Because models reload on demand, you can even leave it permanently wired at the end of a workflow as a self-cleaning step.
The honest caveats: this is a blunt instrument and shouldn't be your default workflow habit. Reloading models costs time - a checkpoint that lives in VRAM gets kicked out and pulled back on the next run - so in a pipeline where you want everything resident for speed, adding this between every step will slow you down. It also can't fix an actual OOM if the failure is "the model is bigger than the card"; it only clears what's there. And it's a manual node: it clears when it executes, so its value is in being placed deliberately, not in running constantly. Use it as the reset, not the routine.
Install is pack-standard: ComfyUI Manager → search ComfyUi-MpiNodes → install, or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
Restart, and it's under MpiNodes/Utils. No requirements file, no model downloads - pure Python on top of what ComfyUI already ships, the same pack behind the Cubric Vision app.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| passthroughopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| passthrough | * | — |