Windecay/ComfyUI-ReservedVRAM

A simple node that can dynamically adjust the reserved memory of a workflow in real-time, used to avoid the utilization of shared memory.

What it solves

This project provides a ComfyUI node that allows users to dynamically adjust the amount of VRAM reserved for a workflow in real-time. This helps prevent Out-of-Memory (OOM) errors and manages shared memory overflow in Windows Task Manager, allowing users to maximize GPU power usage without worrying about memory constraints.

How it works

The node integrates with ComfyUI's memory management systems. It can update the EXTRA_RESERVED_VRAM environment variable or use the model_management.set_extra_reserved_vram() runtime API where available. It also supports compatibility with DynamicVRAM and comfy-aimdo to sync headroom settings. In "Auto" mode, the node detects the amount of "used" VRAM in the system and adds a user-defined value to calculate the reservation.

Who it’s for

Users of ComfyUI who need precise control over their GPU memory to avoid crashes or and optimize performance, particularly those running multiple processes or using high-resolution generations.

Highlights

  • Real-time Adjustment: Change reserved VRAM values (in GB) and have them take effect immediately during workflow execution.
  • Auto Mode: Automatically detects system VRAM usage to prevent processes from hanging.
  • VRAM Cleanup: Includes a toggle to clear VRAM before outputting, effectively acting as a memory cleanup node.
  • Random Seed Integration: Can function as a random seed node that modifies VRAM strategy on every run.
  • Broad Compatibility: Works with official ComfyUI builds and specific extensions like DynamicVRAM and comfy-aimdo.

Related

  • Project
  • Project
  • Project
  • Project