comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
56.5k stars 5.98k forks source link

Slow RAM release. Also no RAM releasing when it's necessary. #2067

Open okolenmi opened 11 months ago

okolenmi commented 11 months ago

First, look at RAM usage graph: изображение

It's 24GB RAM + 16GB Page file during SDXL model loading and run in lowvram mode. There is no any RAM activities between red dots in about 1minute of time, but as you can see RAM is slowly released. Is it possible to do it immediately?

Another thing is that it's impossible to change SDXL model with this amount of RAM. When I trying to load another model I have out of memory error (RAM). It looks like, even if I have limited amount of RAM, ComfyUI will not release RAM from old loaded model, which is no longer relevant. Or maybe problem is only in slow RAM release - memory is releasing but not as fast as it's allocation works.

aleeepp commented 6 months ago

same issue here!! Did you find a solution?

MurtadhaS commented 3 months ago

@aleeepp I restart the service.