Comfy-Org / Comfy-Org/ComfyUI

Models always unloaded when using dynamic VRAM

Open
#13,139 10 comments 1 reaction 1 assignee Claimed by @rattus128 View on GitHub
User Support
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)

### Your question

Hi, I saw that the flag --disable-dynamic-vram will be soon removed.

I'm using a 2 step QWEN edit workflow, a refinement second step, in between the 2 genarations the models are always unloaded and need to be reloaded every time, the same happens when the workflow is completed

I tested adding and removing --fast, --disable-pinned-memory, --lowvram and --normalvram but the issue is the same

Using --disable-dynamic-vram everything is smooth, models are kept in RAM and repeated workflow runs are fast

GeForce RTX 4070 Ti
64 GB of RAM

Models used

qwen_image_edit_2509_bf16.safetensors
qwen_2.5_vl_7b.safetensors

### Logs

```powershell
E:\AI\ComfyUI>python main.py --windows-standalone-build --fast fp16_accumulation --disable-auto-launch --disable-smart-memory --use-sage-attention --preview-method auto --disable-api-nodes --normalvram
C:\Users\Mr. Seri0us\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\__init__.py:113: RequestsDependencyWarning: urllib3 (2.6.3) or chardet (6.0.0.post1)/charset_normalizer (3.4.4) doesn't match a supported version!
warnings.warn(
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2026-03-24 18:08:20.757
** Platform: Windows
** Python version: 3.12.9 (tags/v3.12.9:fdb8142, Feb 4 2025, 15:27:58) [MSC v.1942 64 bit (AMD64)]
** Python executable: C:\Users\Mr. Seri0us\AppData\Local\Programs\Python\Python312\python.exe
** ComfyUI Path: E:\AI\ComfyUI
** ComfyUI Base Folder Path: E:\AI\ComfyUI
** User directory: E:\AI\ComfyUI\user
** ComfyUI-Manager config path: E:\AI\ComfyUI\user\__manager\config.ini
** Log path: E:\AI\ComfyUI\user\comfyui.log

Prestartup times for custom nodes:
0.0 seconds: E:\AI\ComfyUI\custom_nodes\rgthree-comfy
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-easy-use
2.9 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-manager

C:\Users\Mr. Seri0us\AppData\Local\Programs\Python\Python312\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]
Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
Found comfy_kitchen backend cuda: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Checkpoint files will always be loaded safely.
Total VRAM 12282 MB, total RAM 65372 MB
pytorch version: 2.9.1+cu130
Enabled fp16 accumulation.
Set vram state to: NORMAL_VRAM
Disabling smart memory management
Device: cuda:0 NVIDIA GeForce RTX 4070 Ti : cudaMallocAsync
Using async weight offloading with 2 streams
Enabled pinned memory 29417.0
working around nvidia conv3d memory bug.
Using sage attention
aimdo: src-win/cuda-detour.c:77:INFO:aimdo_setup_hooks: found driver at 00007FFB0E570000, installing 4 hooks
aimdo: src-win/cuda-detour.c:61:DEBUG:install_hook_entrys: hooks successfully installed
aimdo: src/control.c:69:INFO:comfy-aimdo inited for GPU: NVIDIA GeForce RTX 4070 Ti (VRAM: 12281 MB)
DynamicVRAM support detected and enabled
Python version: 3.12.9 (tags/v3.12.9:fdb8142, Feb 4 2025, 15:27:58) [MSC v.1942 64 bit (AMD64)]
ComfyUI version: 0.18.1
comfy-aimdo version: 0.2.12
comfy-kitchen version: 0.2.8
ComfyUI frontend version: 1.42.8
[Prompt Server] web root: C:\Users\Mr. Seri0us\AppData\Local\Programs\Python\Python312\Lib\site-packages\comfyui_frontend_package\static
Asset seeder disabled
[E:\AI\ComfyUI\custom_nodes\comfy-mtb] | INFO -> loaded 103 nodes successfuly
[E:\AI\ComfyUI\custom_nodes\comfy-mtb] | INFO -> Some nodes (5) could not be loaded. This can be ignored, but go to http://127.0.0.1:8188/mtb if you want more information.
[Crystools INFO] Crystools version: 1.27.4
[Crystools INFO] Platform release: 11
[Crystools INFO] JETSON: Not detected.
[Crystools INFO] CPU: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz - Arch: AMD64 - OS: Windows 11
[Crystools INFO] pynvml (NVIDIA) initialized.
[Crystools INFO] GPU/s:
[Crystools INFO] 0) NVIDIA GeForce RTX 4070 Ti
[Crystools INFO] NVIDIA Driver: 595.79
[ComfyUI-Easy-Use] server: v1.3.6 Loaded
[ComfyUI-Easy-Use] web root: E:\AI\ComfyUI\custom_nodes\comfyui-easy-use\web_version/v2 Loaded
ComfyUI-GGUF: Allowing full torch compile
### Loading: ComfyUI-Impact-Pack (V8.28.2)
[Impact Pack] Wildcard total size (0.00 MB) is within cache limit (50.00 MB). Using full cache mode.
[Impact Pack] Wildcards loading done.
### Loading: ComfyUI-Impact-Subpack (V1.3.5)
[Impact Pack/Subpack] Using folder_paths to determine whitelist path: E:\AI\ComfyUI\user\default\ComfyUI-Impact-Subpack\model-whitelist.txt
[Impact Pack/Subpack] Ensured whitelist directory exists: E:\AI\ComfyUI\user\default\ComfyUI-Impact-Subpack
[Impact Pack/Subpack] Loaded 0 model(s) from whitelist: E:\AI\ComfyUI\user\default\ComfyUI-Impact-Subpack\model-whitelist.txt
[Impact Subpack] ultralytics_bbox: E:\AI\ComfyUI\models\ultralytics\bbox
[Impact Subpack] ultralytics_segm: E:\AI\ComfyUI\models\ultralytics\segm
### Loading: ComfyUI-Inspire-Pack (V1.23)
jjk_util loding
### Loading: ComfyUI-Manager (V3.39.2)
[ComfyUI-Manager] network_mode: public
[ComfyUI-Manager] ComfyUI per-queue preview override detected (PR #11261). Manager's preview method feature is disabled. Use ComfyUI's --preview-method CLI option or 'Settings > Execution > Live preview method'.
### ComfyUI Version: v0.18.1-5-g2d4970ff | Released on '2026-03-23'
------------------------------------------
Comfyroll Studio v1.76 : 175 Nodes Loaded
------------------------------------------
** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md
** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki
------------------------------------------
[E:\AI\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ckpts path: E:\AI\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts
[E:\AI\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using symlinks: False
[E:\AI\ComfyUI\custom_nodes\comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'MIGraphXExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']
E:\AI\ComfyUI\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")
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
LOADED 6 FONTS

███╗ ███╗ █████╗ ██████╗██╗ ██╗██╗███╗ ██╗███████╗
████╗ ████║██╔══██╗██╔════╝██║ ██║██║████╗ ██║██╔════╝
██╔████╔██║███████║██║ ███████║██║██╔██╗ ██║█████╗
██║╚██╔╝██║██╔══██║██║ ██╔══██║██║██║╚██╗██║██╔══╝
██║ ╚═╝ ██║██║ ██║╚██████╗██║ ██║██║██║ ╚████║███████╗
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝

██████╗ ███████╗██╗ ██╗ ██╗███████╗██╗ ██████╗ ███╗ ██╗███████╗
██╔══██╗██╔════╝██║ ██║ ██║██╔════╝██║██╔═══██╗████╗ ██║██╔════╝
██║ ██║█████╗ ██║ ██║ ██║███████╗██║██║ ██║██╔██╗ ██║███████╗
██║ ██║██╔══╝ ██║ ██║ ██║╚════██║██║██║ ██║██║╚██╗██║╚════██║
██████╔╝███████╗███████╗╚██████╔╝███████║██║╚██████╔╝██║ ╚████║███████║
╚═════╝ ╚══════╝╚══════╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝

# 😺dzNodes: LayerStyle -> Cannot import name 'guidedFilter' from 'cv2.ximgproc'
A few nodes cannot works properly, while most nodes are not affected. Please REINSTALL package 'opencv-contrib-python'.
For detail refer to https://github.com/chflame163/ComfyUI_LayerStyle/issues/5
[tinyterraNodes] Loaded
USDU batch patches applied successfully.
USDU batch patches applied successfully.
Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Success!
Using sage attention
(RES4LYF) Init
(RES4LYF) Importing beta samplers.
(RES4LYF) Importing legacy samplers.

[rgthree-comfy] Loaded 48 extraordinary nodes. 🎉

[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.

Import times for custom nodes:
0.0 seconds: E:\AI\ComfyUI\custom_nodes\websocket_image_save.py
0.0 seconds: E:\AI\ComfyUI\custom_nodes\Comfyui-PainterSampler
0.0 seconds: E:\AI\ComfyUI\custom_nodes\scale-image-to-total-pixels-advanced
0.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI-Wan-SVI2Pro-FLF
0.0 seconds: E:\AI\ComfyUI\custom_nodes\Comfyui-Resolution-Master
0.0 seconds: E:\AI\ComfyUI\custom_nodes\masquerade-nodes-comfyui
0.0 seconds: E:\AI\ComfyUI\custom_nodes\cg-use-everywhere
0.0 seconds: E:\AI\ComfyUI\custom_nodes\Comfyui-PainterFLF2V
0.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI-Jjk-Nodes
0.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI-PainterLongVideo
0.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI-VAE-Utils
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-inpaint-cropandstitch
0.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI-GGUF
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui_essentials
0.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyMath
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-custom-scripts
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-frame-interpolation
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui_ultimatesdupscale
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-kjnodes
0.0 seconds: E:\AI\ComfyUI\custom_nodes\basic_data_handling
0.0 seconds: E:\AI\ComfyUI\custom_nodes\efficiency-nodes-comfyui
0.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes
0.0 seconds: E:\AI\ComfyUI\custom_nodes\rgthree-comfy
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui_tinyterranodes
0.0 seconds: E:\AI\ComfyUI\custom_nodes\comfyui_controlnet_aux
0.1 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-inspire-pack
0.1 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-videohelpersuite
0.1 seconds: E:\AI\ComfyUI\custom_nodes\RES4LYF
0.1 seconds: E:\AI\ComfyUI\custom_nodes\comfyui_layerstyle
0.2 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-impact-pack
0.2 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-easy-use
0.2 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-impact-subpack
0.2 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI-Crystools
0.3 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-florence2
0.4 seconds: E:\AI\ComfyUI\custom_nodes\comfyui_smznodes
0.5 seconds: E:\AI\ComfyUI\custom_nodes\comfy-mtb
0.5 seconds: E:\AI\ComfyUI\custom_nodes\comfyui-manager
0.6 seconds: E:\AI\ComfyUI\custom_nodes\radialattn
2.0 seconds: E:\AI\ComfyUI\custom_nodes\ComfyUI-CacheDiT
4.5 seconds: E:\AI\ComfyUI\custom_nodes\comfyui_fill-nodes

Context impl SQLiteImpl.
Will assume non-transactional DDL.
Starting server

To see the GUI go to: http://127.0.0.1:8188
```

### Other

_No response_

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.