ComfyUI  >  Nodes  >  KJNodes for ComfyUI >  VRAM Debug

ComfyUI Node: VRAM Debug

Class Name

VRAM_Debug

Category
KJNodes/misc
Author
kijai (Account age: 2192 days)
Extension
KJNodes for ComfyUI
Latest Updated
6/25/2024
Github Stars
0.3K

How to Install KJNodes for ComfyUI

Install this extension via the ComfyUI Manager by searching for  KJNodes for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter KJNodes 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
  • 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

VRAM Debug Description

Monitor and manage Video RAM usage for AI models and image processing tasks, optimizing system performance.

VRAM Debug:

The VRAM_Debug node is designed to help you monitor and manage the Video RAM (VRAM) usage of your system, particularly when working with AI models and image processing tasks. This node provides a detailed report on the amount of free VRAM before and after executing specific memory management actions, such as garbage collection, emptying the cache, and unloading all models. By using this node, you can optimize your system's performance, prevent out-of-memory errors, and ensure that your AI models run smoothly. The primary goal of the VRAM_Debug node is to give you insights into your system's memory usage and help you make informed decisions about memory management.

VRAM Debug Input Parameters:

gc_collect

This parameter determines whether to perform garbage collection to free up memory. Garbage collection helps in reclaiming memory that is no longer in use by the program. Setting this parameter to True will trigger garbage collection, which can help in freeing up additional VRAM. The default value is False.

empty_cache

This parameter controls whether to empty the cache to free up memory. Emptying the cache can help in releasing memory that is being held by cached data, which is no longer needed. Setting this parameter to True will clear the cache, potentially freeing up significant VRAM. The default value is False.

unload_all_models

This parameter specifies whether to unload all currently loaded models to free up memory. Unloading models can release a substantial amount of VRAM, especially if you are working with large AI models. Setting this parameter to True will unload all models, making more VRAM available for other tasks. The default value is False.

image_pass

This optional parameter allows you to pass an image through the node. It is primarily used for maintaining the flow of data in a node-based system. If not provided, it defaults to None.

model_pass

This optional parameter allows you to pass a model through the node. Similar to image_pass, it helps in maintaining the flow of data. If not provided, it defaults to None.

any_input

This optional parameter can be used to pass any additional input through the node. It is a flexible parameter that can handle various types of data. If not provided, it defaults to None.

VRAM Debug Output Parameters:

ui

This output parameter provides a user interface element that displays the amount of free VRAM before and after the memory management actions. It is presented as a text string in the format "<freemem_before>x<freemem_after>", which helps you quickly understand the impact of the actions taken.

result

This output parameter returns a tuple containing the original inputs (any_input, image_pass, model_pass) along with the amount of free VRAM before and after the memory management actions. The tuple is structured as (any_input, image_pass, model_pass, freemem_before, freemem_after), providing a comprehensive overview of the memory usage and the effectiveness of the actions taken.

VRAM Debug Usage Tips:

  • Use the gc_collect parameter to trigger garbage collection when you notice that your system's memory usage is high, and you want to free up additional VRAM.
  • Set the empty_cache parameter to True when you need to clear cached data that is no longer needed, especially after running intensive tasks that may have filled up the cache.
  • Utilize the unload_all_models parameter to unload all models when you are done with your current tasks and want to free up a significant amount of VRAM for other processes.

VRAM Debug Common Errors and Solutions:

"Could not pick default device."

  • Explanation: This error occurs when the system is unable to identify the default device for memory management.
  • Solution: Ensure that your system has a compatible GPU or CPU and that the necessary drivers are installed. Check your system's configuration and make sure that the device is properly recognized by the software.

"Warning: Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding."

  • Explanation: This warning indicates that the system ran out of memory while performing VAE decoding and is attempting to use a more memory-efficient method.
  • Solution: Consider freeing up additional VRAM by using the gc_collect, empty_cache, and unload_all_models parameters. You can also try reducing the batch size or the resolution of the images being processed to lower memory usage.

VRAM Debug Related Nodes

Go back to the extension to check out more related nodes.
KJNodes for ComfyUI
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.