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
50.98k stars 5.35k forks source link

RAM memory problem #3035

Open GeLi1989 opened 6 months ago

GeLi1989 commented 6 months ago

I found that after using comfyui for a period of time ( like a week ), the program's RAM memory will continue to accumulate until it becomes too high, and finally the process will terminate.

Excuse me, is there a way to automatically release RAM memory when it reaches a certain level, or is there a way to prevent memory from accumulating continuously?

I have used “--normalvram” command and I know “--disable-smart-memory” My GPU is 3080,VRAM is 10GB MY RAM is 20GB

Is there any way to solve the problem?

Thanks!

petra-pannia commented 6 months ago

I personally use --highvram --disable-smart-memory on an AMD R4750G APU (NVidia 3080 DGPU for you?) × 14.9GiB UMA × 43.7GiB main RAM

And on SDiffXL 6GiB UMA is the max low VRAM

9.31GiB UMA is still average in order to function ComfyUI of SDiffXL

GeLi1989 commented 6 months ago

I only use SD1.5 model and animatediff model,not SDXL

petra-pannia commented 6 months ago

I however instead start by SDiffXL base models but a few SDiff 1.5/1.6 waifues And i’m entirely unsure if AnimatedDiff could record 540p landscape 15:00m+ 25fps Diffused dramas with soundtracks and/or voices, which is still however an unlikely right now even for my AMD R4750G APU × (14.9+43.7)GiB RAM’s

Silversith commented 4 weeks ago

The issue is a memory leak issue in the pytorch build, it's resolved by using the pytorch nightly preview, but that can cause other issues. I did find that I didn't have a RAM buildup after that. Since then I have re-installed my machine and haven't yet installed pytorch nightly.

huangqiaobo commented 3 weeks ago

The issue is a memory leak issue in the pytorch build, it's resolved by using the pytorch nightly preview, but that can cause other issues. I did find that I didn't have a RAM buildup after that. Since then I have re-installed my machine and haven't yet installed pytorch nightly.

I tried the nightly version, but the problem still exists.

pip3 install --pre --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu124