๐Ÿ—‘ Garbage Collector

GarbageCollector

This node releases any memory currently used by ComfyUI and the underlying framework that is not expressly necessary. It does so by requesting garbage collection from several different sources, including ComfyUI itself, Torch and Python's Garbage Collector. Use this node to run workflows that are triggering Out of Memory errors due to RAM exhaustion. It may just be enough to let you run a workflow that would otherwise give you errors and not complete. If your issue stems from a lack of VRAM instead, try this node in conjunction with the [Unload Models] node, immediately after it. The Input and Outputs of this node are a simple passthrough that will forward any data sent through this node, after garbage collection has completed. IF RAM cleaning is enabled, the node will additionally call WinMemoryCleaner.exe to flush memory from Windows and release unused pages from memory. In order for this functionality to work, WinMemoryCleaner.exe must be downloaded from its respective Github (https://github.com/IgorMundstein/WinMemoryCleaner) and placed within the root ComfyUI folder. If Mode is set to Run_Async, WinMemoryCleaner.exe will be executed and the workflow execution will continue automatically. This however requires ComfyUI (or rather Python specifically) to be running with Administrative privileges. Otherwise you can use the 'Wait until Completion' mode which does not require administrative privileges and will block execution for a few seconds and resume when the RAM has been thoroughly cleaned and released. HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO.

Pack: ControlFlowUtils

custom_nodes.ControlFlowUtils

Inputs (3)

NameTypeRequired
Input*required
RAMBOOLEANrequired
ModeBOOLEANrequired

Outputs (1)

NameType
Output*