Free Memory
Out of VRAM on the last stage? Free memory partway through the run
- passthrough
- passthrough
- vram_before
- vram_after
- freed
- report
The classic out-of-memory failure is a long pipeline that dies on its last stage. You load a big model, upscale, and then - just as you reach the video encode or the final pass - ComfyUI tells you there's no room on the card. It feels like the last stage needs too much VRAM. Often it doesn't: the first stages are still resident, hogging memory you need downstream, and the only way to free them from ComfyUI's own menu is… a menu you can't reach while a queue is running.
WAS Free Memory fixes that specific pain. Drop it into the graph at the point where one heavy phase ends and the next begins, and it hands memory back to the graphics card partway through the run, between stages. The tooltip's description is the whole sales pitch: "a chain that loads, upscales and then encodes video can run out on the last stage while the first two are still resident."
How it works
The node calls the same machinery ComfyUI's free-memory menu uses - unloading loaded models and emptying torch's cache - plus a Python garbage collection pass, and reports the numbers before and after so the effect is a figure, not a guess. Three toggles decide what actually happens:
unload_models(on) - hands every loaded checkpoint, VAE, CLIP and ControlNet back. This frees the most. They reload automatically when a node next asks for one, which costs the seconds that load originally took.collect_garbage(on) - runs Python's collector first so things the graph has finished with are actually handed back rather than merely marked unused. Costs a few milliseconds and makes unload worth more.empty_cache(on) - returns to the driver the blocks torch has reserved but isn't using. Torch reuses those blocks itself, so this rarely changes what the next sampler can fit - reach for it when another program, or a library such as OpenCV, needs room on the same card.
To pin the free to a point in the chain, wire passthrough: anything at all (an image, a model, a latent, text) comes back out unchanged once the freeing is done, and nothing wired to the output starts until the free is over. Leave it unwired and the node frees on its own.
What comes back
passthrough (the value that came in, unchanged), vram_before and vram_after (gigabytes in use when the node started and once it finished), freed (before minus after), and report - the device, the used/free/total figures on both sides and what was done, on five lines, drawn on the node and wireable to Display Any or a text save. Wire vram_after into a Compare node to stop a run that still has too little room, which is a genuinely useful guard.
Installing it and reading the fine print
WAS Node Suite v3: ComfyUI Manager → search WAS Node Suite v3, or clone into custom_nodes, restart.
Two honest caveats before you lean on it. First, it runs on every queue rather than being cached, so everything below it runs again as well - place it where that re-run is what you want. Second, unload_models means the next stage pays the reload tax; on a machine where VRAM is tight but the model fits, that tax may cost more wall-clock time than you save. And a machine with no graphics card isn't a problem - it just reports system RAM instead. The freed figure reads negative if another program grabbed memory on the same device while the node ran, which is the one "wait, that can't be right" moment - it's a real number, just a shared device.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| unload_models | BOOLEAN | true | true hands every loaded checkpoint, VAE, CLIP and ControlNet back; false leaves them where they are. This is what frees the most. They load again by themselves when a node next asks for one, which costs the seconds that load took. |
| empty_cache | BOOLEAN | true | true gives the driver back the blocks torch has reserved and is not using. Torch reuses those blocks itself, so this seldom changes what the next sampler can fit; reach for it when another program, or a library such as OpenCV, needs room on the card. |
| collect_garbage | BOOLEAN | true | true runs Python's collector before the cache is emptied, so anything the graph has finished with is actually handed back rather than only marked unused. It costs a few milliseconds and makes unload_models worth more. |
| passthroughopt | COMFY_MATCHTYPE_V3 | Anything at all: an image, a model, a latent, text. It comes back out unchanged once the freeing is done, which is what pins the free to a point in the chain instead of leaving it to happen whenever. Leave it unwired to free on its own. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| passthrough | COMFY_MATCHTYPE_V3 | The value that came in, unchanged, on a socket carrying its type. Nothing wired to it starts until the freeing is over. Empty when nothing was wired into passthrough. |
| vram_before | FLOAT | Gigabytes in use on the device ComfyUI computes on when the node started, as 18.42. On a machine with no graphics card that device is the processor and the figure is system RAM. |
| vram_after | FLOAT | The same figure once the freeing has finished, as 2.10. Wire it into Compare to stop a run that still has too little room, or into Text Concatenate to record it. |
| freed | FLOAT | vram_before minus vram_after, in gigabytes, as 16.32. 0.00 means nothing was handed back. It reads negative when another program took memory on the same device while this ran. |
| report | STRING | The device, the used, free and total figures on both sides, what was done and how much came back, on five lines. Drawn on the node and wireable to Display Any or Text Save. |