ComfyUI > Nodes > ComfyUI-DistorchMemoryManager

ComfyUI Extension: ComfyUI-DistorchMemoryManager

Repo Name

ComfyUI-DistorchMemoryManager

Author
ussoewwin (Account age: 1026 days)
Nodes
View all nodes(4)
Latest Updated
2026-03-28
Github Stars
0.03K

How to Install ComfyUI-DistorchMemoryManager

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

ComfyUI-DistorchMemoryManager Description

ComfyUI-DistorchMemoryManager is a custom node for ComfyUI that enhances memory management by efficiently handling GPU/CPU resources, optimizing performance through its Distorch memory management capabilities.

ComfyUI-DistorchMemoryManager Introduction

ComfyUI-DistorchMemoryManager is a specialized extension designed to enhance memory management within the ComfyUI environment. This extension is particularly beneficial for AI artists who work with complex video generation workflows, such as upscaling, which can often lead to out-of-memory (OOM) errors. These errors are typically due to system RAM shortages rather than VRAM shortages, even on systems with substantial RAM. By efficiently managing both GPU and CPU memory, ComfyUI-DistorchMemoryManager helps prevent these issues, ensuring smoother and more reliable performance during intensive tasks.

How ComfyUI-DistorchMemoryManager Works

At its core, ComfyUI-DistorchMemoryManager operates by optimizing memory usage through a series of custom nodes. These nodes are designed to clear unnecessary data from memory, manage model loading and unloading, and perform garbage collection. Imagine your computer's memory as a workspace cluttered with tools and materials. This extension acts like a diligent assistant, tidying up the workspace by putting away tools that are no longer needed, thus freeing up space for new tasks. This process helps prevent the workspace from becoming too cluttered, which can slow down or halt your work.

ComfyUI-DistorchMemoryManager Features

Model Patch Memory Cleaner

This feature is specifically designed for workflows involving ModelPatchLoader. It clears model patches to prevent OOM errors during upscaling. By ensuring that only necessary data is retained in memory, it helps maintain optimal performance.

  • Options:
  • clear_model_patches: Removes model patches.
  • clean_gpu: Clears GPU memory.
  • force_gc: Forces garbage collection.

Purge VRAM V2 Compatibility

This node restores and enhances the LayerUtility: Purge VRAM V2 functionality, supporting various models like SeedVR2, Qwen3-VL, and Nunchaku. It aggressively unloads models and clears caches to free up memory.

  • Options:
  • purge_cache: Clears caches and performs garbage collection.
  • purge_models: Unloads unused models.
  • purge_seedvr2_models: Clears SeedVR2 models.
  • purge_qwen3vl_models: Clears Qwen3-VL models.
  • purge_nunchaku_models: Clears Nunchaku models.

Memory Manager (Advanced)

This node offers comprehensive memory management for advanced users, allowing detailed control over memory clearing processes.

  • Options:
  • clean_gpu: Clears GPU memory.
  • clean_cpu: Clears CPU memory (use cautiously).
  • force_gc: Forces garbage collection.
  • reset_virtual_memory: Resets virtual memory.

Patch Sage Attention DM

An experimental feature that replaces ComfyUI's standard attention mechanism with SageAttention, improving memory efficiency and performance.

  • Options:
  • sage_attention: Selects SageAttention mode.
  • allow_compile: Enables torch.compile for SageAttention.

Troubleshooting ComfyUI-DistorchMemoryManager

Common Issues and Solutions

  • Out of Memory Errors: Use the Model Patch Memory Cleaner or Memory Manager nodes to clear unnecessary data and free up memory.
  • OOM During Upscaling: Ensure the Model Patch Memory Cleaner is used after ControlNet usage and before upscaling.
  • UI Corruption: Avoid enabling clean_cpu unless necessary, as it may cause UI issues.
  • OOM with Specific Models: Use the Purge VRAM V2 node with appropriate options to clear model-specific memory.

Learn More about ComfyUI-DistorchMemoryManager

For further assistance and resources, consider exploring community forums and tutorials that focus on memory management in AI workflows. Engaging with these communities can provide valuable insights and support, helping you make the most of the ComfyUI-DistorchMemoryManager extension.

ComfyUI-DistorchMemoryManager Related Nodes

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.

ComfyUI-DistorchMemoryManager detailed guide | ComfyUI