Comfy-Org / Comfy-Org/ComfyUI

0.27.1 - Memory Usage Degraded even more AGAIN

Open
#14,907 7 comments 20 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

related to:
https://github.com/Comfy-Org/ComfyUI/issues/12541
https://github.com/Comfy-Org/ComfyUI/issues/13042

### Title
Memory Usage Degraded even more AGAIN (v0.27.1) - Disk re-reads on every prompt change & increased RAM consumption

### Description
**Issue body actions**

#### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists.

#### Expected Behavior
- When changing the prompt (i.e., updating the CLIP Text Encode node and accessing the text encoder), the model and text encoder weights should remain cached in memory.
- A simple prompt change should be processed quickly without triggering massive disk I/O, as the required components are already loaded.
- Memory management should efficiently keep necessary components in RAM/VRAM between generations, just as it did in older, stable versions of ComfyUI.

#### Actual Behavior
- I am using `QwenImageEdit GGUF`. The memory degradation has now reached a point where it is completely unusable.
- Every single time I change the prompt (which updates the CLIP Text Encode node and accesses the text encoder), ComfyUI completely re-reads the model weights from the disk.
- This results in massive disk thrashing, extreme delays, and constant swapping. What used to take seconds now takes minutes because the system is constantly re-loading gigabytes of data from the SSD just to process a new text prompt.
- **Furthermore, overall system RAM consumption has noticeably increased** compared to older stable versions, which severely exacerbates the swapping and disk thrashing issues.
- The memory caching is entirely broken; it fails to retain the text encoder and model state in memory between simple parameter changes.

#### Steps to Reproduce
1. Install/Update to ComfyUI version 0.27.1.
2. Load a workflow using `QwenImageEdit GGUF`.
3. Run a generation successfully.
4. Change the text prompt in the CLIP Text Encode node.
5. Queue the prompt again.
6. Observe the massive disk read activity, increased system RAM footprint, and extreme lag as the system re-reads the model from the disk instead of utilizing cached memory.

#### Environment
- OS: Windows 11
- GPU: RTX 5060 Ti (16GB VRAM)
- System RAM: 32GB
- ComfyUI Version: 0.27.1

#### Additional Context & Root Cause Analysis
It is incredibly frustrating to watch this software degrade over time. Here is why this is undeniably a bug and a complete failure of memory management:

1. **Half a Year of Continuous Regression:** This issue didn't appear overnight. For over six months, the situation has been getting worse with every single update. Initially, everything worked perfectly. Without changing the models and without changing the workflow, the performance of the exact same model on the exact same workflow has steadily deteriorated from version to version.
2. **Absurd Disk Thrashing & RAM Bloat:** Re-reading the entire model from the disk just because the text prompt changed is objectively broken behavior. Combined with the noticeable increase in baseline RAM consumption, it proves that the memory caching and model state management are fundamentally flawed.
3. **Not a Subjective or Isolated Issue:** This is not just my subjective opinion or an isolated edge case. Friends and acquaintances of mine who use similar setups have noticed the exact same severe degradation. Furthermore, this is corroborated by a massive amount of similar bug reports right here on this GitHub repository. The entire community is collectively witnessing this regression.
4. **Dismissal Instead of Action:** Instead of opening their eyes and acknowledging this severe, community-wide regression, the developers' standard response has been to dismiss users, accuse them of writing "dumb AI bug reports" on neuro-posts, and ignore the technical evidence and hotfixes provided by the community (as seen in #12541 and #13042).
5. **Misplaced Priorities:** Rather than fixing the core memory management issues that are making the software nearly unusable for GGUF/quantized model users, the recent updates have been heavily focused on pushing and integrating commercial nodes. It feels like basic, foundational functionality is being sacrificed while monetization takes priority.

Please stop blaming the users for "AI bug reports" and actually look at the memory profiling. The evidence is right there, reported by dozens of users. Fix the memory leaks, address the RAM bloat, and fix the caching logic.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in ComfyUI 0.27.1 with a QwenImageEdit GGUF workflow on Windows 11, then compare disk reads and RAM use before and after changing the CLIP Text Encode prompt. Trace the model and text-encoder loading and caching path; done means a prompt-only change reuses cached weights without repeated multi-gigabyte reads or the reported RAM growth.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.