ComfyUI Node: Global Memory Cleanup

Class Name

GlobalMemoryCleanup

Category
Shrug Nodes/Memory
Author
fblissjr (Account age: 4014days)
Extension
Shrug-Prompter: Unified VLM Integration for ComfyUI
Latest Updated
2025-09-30
Github Stars
0.02K

How to Install Shrug-Prompter: Unified VLM Integration for ComfyUI

Install this extension via the ComfyUI Manager by searching for Shrug-Prompter: Unified VLM Integration for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Shrug-Prompter: Unified VLM Integration for ComfyUI 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Global Memory Cleanup Description

GlobalMemoryCleanup optimizes AI performance by managing memory with customizable cleanup modes.

Global Memory Cleanup:

GlobalMemoryCleanup is a crucial node designed for the shrug-prompter system, providing a centralized mechanism to efficiently manage and clean up memory resources across various components. Its primary purpose is to ensure optimal performance by clearing caches, accumulators, and other memory-intensive structures that may accumulate during the execution of AI tasks. This node is particularly beneficial in environments where memory resources are limited or when running complex workflows that require frequent memory management. By offering different cleanup modes, such as normal, aggressive, and nuclear, GlobalMemoryCleanup allows you to tailor the memory management process to your specific needs, ensuring that resources are freed up effectively without disrupting ongoing processes. This node is essential for maintaining the stability and efficiency of AI-driven applications, especially those involving intensive computations or large datasets.

Global Memory Cleanup Input Parameters:

trigger

The trigger parameter is used to initiate the memory cleanup process. It acts as a signal to start the cleanup operation, ensuring that the node performs its function at the appropriate time within a workflow. This parameter does not have specific values or options, as it primarily serves as a control mechanism to activate the cleanup process.

cleanup_mode

The cleanup_mode parameter determines the intensity and scope of the memory cleanup operation. It accepts options such as "normal," "aggressive," and "nuclear," each representing a different level of cleanup. The "normal" mode clears basic caches and accumulators, "aggressive" mode includes garbage collection and more thorough cleanup, while "nuclear" mode performs the most extensive cleanup, including clearing CUDA caches if applicable. The default value is "normal," and selecting the appropriate mode can significantly impact the node's execution and the overall system performance.

verbose

The verbose parameter controls the level of detail included in the cleanup report. When set to True, it provides detailed feedback on the cleanup process, including the number of items cleared and memory freed. This can be particularly useful for debugging or monitoring purposes. The default value is True, and it can be set to False if detailed reporting is not required.

Global Memory Cleanup Output Parameters:

report_lines

The report_lines output parameter provides a detailed report of the memory cleanup operation. It includes information on the number of caches, accumulators, and other memory structures that were cleared, as well as any garbage collection activities performed. This output is essential for understanding the impact of the cleanup process and verifying that memory resources have been effectively managed.

total_freed

The total_freed output parameter indicates the total number of memory items that were freed during the cleanup process. This includes entries from caches, accumulators, and other memory structures. Understanding this output helps in assessing the efficiency of the cleanup operation and ensuring that sufficient memory resources are available for subsequent tasks.

Global Memory Cleanup Usage Tips:

  • Use the cleanup_mode parameter to tailor the memory cleanup process to your specific needs. For routine operations, "normal" mode is usually sufficient, but for more intensive tasks, consider using "aggressive" or "nuclear" modes to ensure optimal performance.
  • Enable the verbose parameter to receive detailed feedback on the cleanup process, which can be invaluable for monitoring system performance and diagnosing potential memory issues.

Global Memory Cleanup Common Errors and Solutions:

CUDA error: out of memory

  • Explanation: This error occurs when the GPU runs out of memory, often due to insufficient cleanup of CUDA resources.
  • Solution: Use the "nuclear" cleanup mode to clear CUDA caches and synchronize memory, ensuring that GPU resources are adequately freed.

MemoryError: Unable to allocate memory

  • Explanation: This error indicates that the system is unable to allocate the required memory, possibly due to excessive memory usage by caches or accumulators.
  • Solution: Increase the frequency of memory cleanup operations or switch to a more aggressive cleanup mode to free up additional memory resources.

Global Memory Cleanup Related Nodes

Go back to the extension to check out more related nodes.
Shrug-Prompter: Unified VLM Integration for ComfyUI
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Global Memory Cleanup