ComfyUI  >  Nodes  >  ControlFlowUtils >  🗑 Garbage Collector

ComfyUI Node: 🗑 Garbage Collector

Class Name

GarbageCollector

Category
🐺 VykosX-ControlFlowUtils
Author
VykosX (Account age: 2024 days)
Extension
ControlFlowUtils
Latest Updated
10/1/2024
Github Stars
0.1K

How to Install ControlFlowUtils

Install this extension via the ComfyUI Manager by searching for  ControlFlowUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ControlFlowUtils in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🗑 Garbage Collector Description

Optimizes memory usage by releasing unnecessary memory, beneficial for high-consumption workflows in ComfyUI.

🗑 Garbage Collector:

The GarbageCollector node is designed to optimize the memory usage of ComfyUI by releasing any memory that is not currently necessary. This node is particularly useful for workflows that involve multiple models or operations that can lead to high memory consumption. By invoking garbage collection, the node helps in freeing up VRAM and RAM, ensuring smoother and more efficient performance. This can be especially beneficial if you are experiencing VRAM issues or if your workflow requires frequent loading and unloading of models. The GarbageCollector node can be configured to either forcefully unload models immediately or request unloading, allowing ComfyUI to handle it at its convenience. This flexibility helps in managing memory without disrupting the workflow.

🗑 Garbage Collector Input Parameters:

Input

This parameter accepts any type of data that you want to forward to other nodes after the memory cleaning process. It acts as a passthrough, ensuring that your data continues to flow through the workflow seamlessly. There are no specific minimum or maximum values for this parameter as it is designed to handle any type of input.

RAM

This boolean parameter, labeled as "Free Unused Memory (Windows only)," attempts to clear the RAM on Windows systems. It requires the WinMemoryCleaner.exe to be placed in the ComfyUI root folder. The default value is True, meaning it will attempt to free unused memory by default. This can help in reducing the overall memory footprint of your workflow.

Mode

This boolean parameter, labeled as "Run Async. (Requires Admin)," specifies whether to wait for the memory cleaning process to complete before continuing with the workflow. If set to True, the node will run asynchronously, which requires administrative privileges. The default value is False, meaning the node will wait until the memory cleaning process is complete before proceeding.

🗑 Garbage Collector Output Parameters:

Output

This parameter outputs the data that was passed through the Input parameter after the memory cleaning process. It ensures that your data continues to flow through the workflow without any interruption. The output type is the same as the input type, maintaining consistency in your workflow.

🗑 Garbage Collector Usage Tips:

  • Insert the GarbageCollector node between operations in your workflow to manage memory usage effectively, especially if you are working with multiple models.
  • Use the RAM parameter to free up unused memory on Windows systems, which can help in reducing the overall memory footprint.
  • Configure the Mode parameter based on your workflow requirements. If you need the memory cleaning process to complete before proceeding, set it to False. If you prefer to run it asynchronously, set it to True but ensure you have administrative privileges.

🗑 Garbage Collector Common Errors and Solutions:

"WinMemoryCleaner.exe not found"

  • Explanation: The WinMemoryCleaner.exe file is required to free unused memory on Windows systems.
  • Solution: Ensure that the WinMemoryCleaner.exe file is placed in the ComfyUI root folder.

"Insufficient privileges for asynchronous operation"

  • Explanation: Running the node asynchronously requires administrative privileges.
  • Solution: Run ComfyUI with administrative privileges or set the Mode parameter to False to wait for the memory cleaning process to complete.

"Memory cleaning failed"

  • Explanation: The memory cleaning process may fail due to various reasons, such as insufficient system resources or conflicts with other applications.
  • Solution: Check system resources and ensure no conflicting applications are running. Retry the memory cleaning process or adjust the node configuration.

🗑 Garbage Collector Related Nodes

Go back to the extension to check out more related nodes.
ControlFlowUtils
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.