Recent memory changes cause system freeze
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [x] 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
I expect the vram offloading to offload unused models to cpu ram and unload if it doesn't fit.
### Actual Behavior
The model gets offloaded to cpu ram even if it doesn't fit (Shows as 48/48gb cpu ram), which causes my pc to rely on swapfile which causes my pc to freeze.
In earlier versions this seemed to be what happened, now it forces it into cpu ram always.
### Steps to Reproduce
I have 16gb vram and 48gb cpu ram and I'm running windows 11
1. Load a memory intensive workflow (like wan 2.2 a14b for example, in fp8 still works since the text encoder and vae will still be loaded)
2. Run the workflow and watch the cpu memory usage, memory usage will fill up to 100%, then the pc will slow down dramatically
Previous versions would have unloaded the model, I first noticed this issue yesterday morning.
### Debug Logs
```powershell
The computer freezes so I can't get the logs. Although I doubt anything was logged anyway.
```
### Other
Seems to have started around yesterday morning (somewhere before 5ebcab3c7d974963a89cecd37296a22fdb73bd2b), generating images with large models like wan 2.2 a14b (which originally worked fine in fp8 due to unloading) has become unusable due to the freezes.
Contributor guide
Assessment
This issue has not been assessed yet.