ComfyUI Node
arkennemasis Purge VRAM (between stages)
Unload every model and empty the CUDA cache, then pass the input straight through. Put it between two stages that use different big models so the second one starts with the memory free.
arkennemasis Purge VRAM (between stages)
- images
- anything
- images
- anything
- report
◄unload_modelstrue►
◄empty_cachetrue►
◄collect_garbagetrue►
Categoryarkennemasis/Utility
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| unload_models | BOOLEAN | true | Evict every loaded model from VRAM. This is the one that actually frees the gigabytes. |
| empty_cache | BOOLEAN | true | Return PyTorch's cached blocks to the driver. Without this the memory stays reserved and the next model still cannot see it. |
| collect_garbage | BOOLEAN | true | Run Python's collector first, so tensors waiting on a reference cycle are actually released. |
| imagesopt | IMAGE | Wire the image generator in here and take `images` back out into the next stage. That link is what makes ComfyUI run the purge at this point in the graph. | |
| anythingopt | * | Same idea for anything that is not an image — any type in, the same value out. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| anything | * | — |
| report | STRING | — |