This node forcefully unloads all models currently loaded by ComfyUI into VRAM. Typically, ComfyUI's memory management does a very good job at managing VRAM automatically to prevent Out of Memory errors. However, on occasion, it may either fail or start paging models into Shared Memory which leads to very slow generation.
If you are having VRAM issues or your workflow utilizes multiple models that do not all need to be loaded to memory simultaneously, it may be very useful to be able to clear them on demand. Simply insert this node in between other operations in your workflow and all the loaded models will be removed from your VRAM.
There are two models of operation depending on the value of ForceUnload. If Enabled, all models will be unloaded immediately, which may cause issues with the workflow if any pending nodes still require access to the model. If Disabled, Model Unloading will be requested instead and ComfyUI will handle unloading it at its earliest convenience. This is analogous to clicking the Unload Model button directly in ComfyUI itself.
HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO.
By VykosX·Created 2 years ago·Updated 2 years ago· 147
❌ Unload Models
Passthrough
Output
◄ForceUnloadfalse►
Category🐺 VykosX-ControlFlowUtils
Inputs (2)
Name
Type
Default
Description
Passthrough
*
Data to forward to other nodes after cleaning the VRAM
ForceUnload
BOOLEAN
false
Specifies how the models should be unloaded. Instantly or On-Demand
Outputs (1)
Name
Type
Description
Output
*
Data that will be forwarded to other nodes after cleaning the VRAM