Comfy-Org / Comfy-Org/ComfyUI

--no-cache-models startup flag

Open
#9,250 13 comments 19 reactions 0 assignees View on GitHub
bug-cop:triaged Feature
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

### Feature Idea

A launch argument to make Comfy discard models after inference instead of caching them back to RAM.

Right now, the way model loading is handled goes:
load to RAM -> load to VRAM -> infer -> load back and cache to RAM when VRAM is needed for other things

To provide an example usecase, Wan 2.2 HIGH and LOW noise models both get cached in RAM after they have been used, even though the workflow no longer needs the HIGH model during inference with LOW. This causes RAM to fill up quite a bit, potentially causing system hangs in some cases.

While flags such as `--cache-none` exists, it makes Comfy not cache anything, including models or execution data, but models are typically the things most likely to cause RAM capacity issues so the ability to not cache them would be beneficial while preserving execution cache so that every node doesn't need reprocessing each time.

### Existing Solutions

_No response_

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