Comfy-Org / Comfy-Org/ComfyUI

Memory Management Regression in ComfyUI (Update 13)

Open
#12,541 12 comments 8 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [ ] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

- Models should load into RAM first, then offload to VRAM for inference, and subsequently be unloaded from RAM (proper memory offloading).
- Example workflow: Running "qwen image edit" with 4 reference images and generating up to 2K resolution should consume no more than 20GB RAM total.
- Memory should be efficiently managed across all models (e.g., Ace Step 1.5 after cold boot: ~8-10GB RAM usage, rest in VRAM).

### Actual Behavior

- Memory is not being offloaded from RAM after models are moved to VRAM.
- Constant swapping/pagefile activity occurs between RAM and disk, potentially reducing SSD lifespan due to excessive writes.
- RAM consumption spikes to full capacity (32GB) during a single generation.
- Even after cold boot, Ace Step 1.5 now consumes up to 20GB RAM (vs. previous 8-10GB).
- System performance degraded significantly; workflows that previously ran smoothly are now nearly impossible to execute.

### Steps to Reproduce

- Install ComfyUI Update 13 (with all associated updates).
- Load a model (e.g., qwen image edit or Ace Step 1.5) with moderate resource settings.
- Attempt a generation with multiple reference images (e.g., 4 references, up to 2K resolution).
- Monitor RAM usage, VRAM allocation, and pagefile activity.

### Debug Logs

```powershell
** ComfyUI startup time: 2026-02-20 08:30:23.426
[2026-02-20 08:30:23.427] ** Platform: Windows
[2026-02-20 08:30:23.427] ** Python version: 3.12.9 (main, Feb 12 2025, 14:52:31) [MSC v.1942 64 bit (AMD64)]
[2026-02-20 08:30:23.427] ** Python executable: D:\NEURO\FILES\.venv\Scripts\python.exe
[2026-02-20 08:30:23.427] ** ComfyUI Path: D:\NEURO\ComfyUI\resources\ComfyUI
[2026-02-20 08:30:23.427] ** ComfyUI Base Folder Path: D:\NEURO\ComfyUI\resources\ComfyUI
[2026-02-20 08:30:23.427] ** User directory: D:\NEURO\FILES\user
[2026-02-20 08:30:23.427] ** ComfyUI-Manager config path: D:\NEURO\FILES\user\__manager\config.ini
[2026-02-20 08:30:23.428] ** Log path: D:\NEURO\FILES\user\comfyui.log
[ComfyUI-Manager] Skipped fixing the 'comfyui-frontend-package' dependency because the ComfyUI is outdated.
[2026-02-20 08:30:24.892] [PRE] ComfyUI-Manager
[2026-02-20 08:30:25.547] D:\NEURO\FILES\.venv\Lib\site-packages\torch\cuda\__init__.py:63: FutureWarning: The pynvml package is deprecated. Please install nvidia-ml-py instead. If you did not install pynvml directly, please report this to the maintainers of the package that installed pynvml for you.
import pynvml # type: ignore[import]
[2026-02-20 08:30:28.034] WARNING: You need pytorch with cu130 or higher to use optimized CUDA operations.
[2026-02-20 08:30:28.035] Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
[2026-02-20 08:30:28.035] Found comfy_kitchen backend cuda: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
[2026-02-20 08:30:28.035] Found comfy_kitchen backend triton: {'available': False, 'disabled': True, 'unavailable_reason': "ImportError: No module named 'triton'", 'capabilities': []}
[2026-02-20 08:30:28.046] Checkpoint files will always be loaded safely.
[2026-02-20 08:30:28.135] Total VRAM 16310 MB, total RAM 32690 MB
[2026-02-20 08:30:28.135] pytorch version: 2.8.0+cu129
[2026-02-20 08:30:28.137] Set vram state to: NORMAL_VRAM
[2026-02-20 08:30:28.138] Device: cuda:0 NVIDIA GeForce RTX 5060 Ti : cudaMallocAsync
[2026-02-20 08:30:28.155] Using async weight offloading with 2 streams
[2026-02-20 08:30:28.155] Enabled pinned memory 14710.0
[2026-02-20 08:30:28.679] Using pytorch attention
[2026-02-20 08:30:37.586] Python version: 3.12.9 (main, Feb 12 2025, 14:52:31) [MSC v.1942 64 bit (AMD64)]
[2026-02-20 08:30:37.586] ComfyUI version: 0.14.1
[2026-02-20 08:30:37.622] [Prompt Server] web root: D:\NEURO\ComfyUI\resources\ComfyUI\web_custom_versions\desktop_app
[2026-02-20 08:30:37.624] [START] ComfyUI-Manager
[2026-02-20 08:30:37.811] [ComfyUI-Manager] network_mode: public
[2026-02-20 08:30:37.843] [ComfyUI-Manager] The matrix sharing feature has been disabled because the `matrix-nio` dependency is not installed.
To use this feature, please run the following command:
D:\NEURO\FILES\.venv\Scripts\python.exe -m pip install matrix-nio

[2026-02-20 08:30:41.118] [Crystools INFO] Crystools version: 1.27.4
[2026-02-20 08:30:41.157] [Crystools INFO] Platform release: 11
[2026-02-20 08:30:41.157] [Crystools INFO] JETSON: Not detected.
[2026-02-20 08:30:41.158] [Crystools INFO] CPU: AMD Ryzen 5 3600 6-Core Processor - Arch: AMD64 - OS: Windows 11
[2026-02-20 08:30:41.170] [Crystools INFO] pynvml (NVIDIA) initialized.
[2026-02-20 08:30:41.170] [Crystools INFO] GPU/s:
[2026-02-20 08:30:41.181] [Crystools INFO] 0) NVIDIA GeForce RTX 5060 Ti
[2026-02-20 08:30:41.182] [Crystools INFO] NVIDIA Driver: 591.86
[2026-02-20 08:30:41.230] ### Loading: ComfyUI-Impact-Pack (V8.28.2)
[2026-02-20 08:30:41.445] [Impact Pack] Wildcard total size (0.00 MB) is within cache limit (50.00 MB). Using full cache mode.
[2026-02-20 08:30:41.446] [Impact Pack] Wildcards loading done.
[2026-02-20 08:30:43.134] (pysssss:WD14Tagger) [DEBUG] Available ORT providers: AzureExecutionProvider, CPUExecutionProvider
[2026-02-20 08:30:43.134] (pysssss:WD14Tagger) [DEBUG] Using ORT providers: CUDAExecutionProvider, CPUExecutionProvider
[2026-02-20 08:30:43.171] [D:\NEURO\FILES\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ckpts path: D:\NEURO\FILES\custom_nodes\comfyui_controlnet_aux\ckpts
[2026-02-20 08:30:43.172] [D:\NEURO\FILES\custom_nodes\comfyui_controlnet_aux] | INFO -> Using symlinks: False
[2026-02-20 08:30:43.174] [D:\NEURO\FILES\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']
[2026-02-20 08:30:43.204] D:\NEURO\FILES\custom_nodes\comfyui_controlnet_aux\node_wrappers\dwpose.py:26: UserWarning: DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly
warnings.warn("DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly")
[2026-02-20 08:30:43.364] USDU batch patches applied successfully.
[2026-02-20 08:30:43.364] USDU batch patches applied successfully.
[2026-02-20 08:30:45.564]
********
Warning: flash-attn is not installed. Will only run the manual PyTorch version. Please install flash-attn for faster inference.
********

[2026-02-20 08:30:45.704] Training node missing dependencies: No module named 'qwen_tts.finetuning'
[2026-02-20 08:30:45.704] ✅ ComfyUI-Qwen-TTS v1.0.6 loaded
[2026-02-20 08:30:45.737]
[2026-02-20 08:30:45.737] [rgthree-comfy] Loaded 48 epic nodes. 🎉
[2026-02-20 08:30:45.737]
[2026-02-20 08:30:45.737] [rgthree-comfy] ComfyUI's new Node 2.0 rendering may be incompatible with some rgthree-comfy nodes and features, breaking some rendering as well as losing the ability to access a node's properties (a vital part of many nodes). It also appears to run MUCH more slowly spiking CPU usage and causing jankiness and unresponsiveness, especially with large workflows. Personally I am not planning to use the new Nodes 2.0 and, unfortunately, am not able to invest the time to investigate and overhaul rgthree-comfy where needed. If you have issues when Nodes 2.0 is enabled, I'd urge you to switch it off as well and join me in hoping ComfyUI is not planning to deprecate the existing, stable canvas rendering all together.
[2026-02-20 08:30:45.737]
[2026-02-20 08:30:45.768] Blocked by policy: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\ComfyUI-Manager
[2026-02-20 08:30:45.782] [D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ckpts path: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts
[2026-02-20 08:30:45.783] [D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using symlinks: False
[2026-02-20 08:30:45.783] [D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']
[2026-02-20 08:30:45.836]
Import times for custom nodes:
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\websocket_image_save.py
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\ComfyUI--Wan22FirstLastFrameToVideoLatent
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\Image-Captioning-in-ComfyUI
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\ComfyUI--Wan22FirstLastFrameToVideoLatent
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui_imageprocessing
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\a-person-mask-generator
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfy-image-saver
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\ComfyUI-VAE-Utils
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui-basic-math
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\qwen3-tts-comfyui
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui-post-processing-nodes
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui-wd14-tagger
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\stable-diffusion-temperature-settings
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\FILES\custom_nodes\ComfyUI_Custom_Switch
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfyui_ipadapter_plus
[2026-02-20 08:30:45.836] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfyui-propost
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\flowmatching-inverter
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui_tag_fillter
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfy-image-saver
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\ComfyUI-Whisper
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui_ipadapter_plus_v2
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\wavespeed
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\steerable-motion
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\wavespeed
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui-frame-interpolation
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\ComfyUI-Whisper
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\rgthree-comfy
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui-kjnodes
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\FILES\custom_nodes\comfyui_ipadapter_plus
[2026-02-20 08:30:45.837] 0.0 seconds: D:\NEURO\ComfyUI\resources\ComfyUI\custom_nodes\comfyui_controlnet_aux
[2026-02-20 08:30:45.837] 0.1 seconds: D:\NEURO\FILES\custom_nodes\comfyui_controlnet_aux
[2026-02-20 08:30:45.837] 0.1 seconds: D:\NEURO\FILES\custom_nodes\comfyui-videohelpersuite
[2026-02-20 08:30:45.837] 0.1 seconds: D:\NEURO\FILES\custom_nodes\comfyui_ultimatesdupscale
[2026-02-20 08:30:45.837] 0.1 seconds: D:\NEURO\FILES\custom_nodes\gguf
[2026-02-20 08:30:45.837] 0.2 seconds: D:\NEURO\FILES\custom_nodes\neuroseparatism
[2026-02-20 08:30:45.838] 0.2 seconds: D:\NEURO\FILES\custom_nodes\comfyui-impact-pack
[2026-02-20 08:30:45.838] 0.3 seconds: D:\NEURO\FILES\custom_nodes\ComfyUI-lut
[2026-02-20 08:30:45.838] 0.3 seconds: D:\NEURO\FILES\custom_nodes\LTX-Side
[2026-02-20 08:30:45.838] 0.4 seconds: D:\NEURO\FILES\custom_nodes\ComfyUI-Crystools
[2026-02-20 08:30:45.838] 0.5 seconds: D:\NEURO\FILES\custom_nodes\audio-separation-nodes-comfyui
[2026-02-20 08:30:45.838] 0.6 seconds: D:\NEURO\FILES\custom_nodes\comfyui-propost
[2026-02-20 08:30:45.838] 0.7 seconds: D:\NEURO\FILES\custom_nodes\comfyui-matchering
[2026-02-20 08:30:45.838] 0.8 seconds: D:\NEURO\FILES\custom_nodes\a-person-mask-generator
[2026-02-20 08:30:45.838] 1.7 seconds: D:\NEURO\FILES\custom_nodes\qwen3-tts
[2026-02-20 08:30:45.838]
[2026-02-20 08:30:45.846] Context impl SQLiteImpl.
[2026-02-20 08:30:45.846] Will assume non-transactional DDL.
[2026-02-20 08:30:46.867] Assets scan(roots=['models']) completed in 1.019s (created=0, skipped_existing=236, orphans_pruned=0, total_seen=238)
[2026-02-20 08:30:46.984] Starting server

[2026-02-20 08:30:46.985] To see the GUI go to: http://127.0.0.1:8000
[2026-02-20 08:30:48.235] comfyui-frontend-package not found in requirements.txt
[2026-02-20 08:30:48.652] [DEPRECATION WARNING] Detected import of deprecated legacy API: /scripts/ui/components/buttonGroup.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
[2026-02-20 08:30:48.655] [DEPRECATION WARNING] Detected import of deprecated legacy API: /scripts/ui.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
[2026-02-20 08:30:48.657] [DEPRECATION WARNING] Detected import of deprecated legacy API: /extensions/core/clipspace.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
[2026-02-20 08:30:48.659] [DEPRECATION WARNING] Detected import of deprecated legacy API: /extensions/core/widgetInputs.js. This is likely caused by a custom node extension using outdated APIs. Please update your extensions or contact the extension author for an updated version.
```

### Other

Environment:

- OS: Windows 11
- GPU: RTX 5060 Ti (16GB VRAM)
- System RAM: 32GB
- ComfyUI Version: After Update 13 (regression from previous behavior) - 0.14.2 / 0.8.6

Observed Result:

- RAM usage steadily increases and does not decrease even after model inference is complete.
- Pagefile thrashing observed; disk activity high.
- System becomes unresponsive or extremely slow during/after generation.

Expected Result:

- RAM usage should stabilize after model offloading to VRAM.
- Pagefile usage should be minimal and not impact disk lifespan.
- Generation should complete within previously observed resource limits (~20GB RAM).

Impact:

- Severe degradation in usability for users with 32GB RAM and 16GB VRAM.
- Potential hardware wear due to excessive pagefile writes.
- Affects multiple models, not just the examples given.

Additional Notes:

- No hardware or software changes were made besides updating ComfyUI.
- Issue is consistent across different models and workflows.
- This appears to be a regression in memory management/offloading logic introduced in Update 13

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.