AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
141.79k stars 26.78k forks source link

[Bug]: Memory leak in batch img2img #14448

Open Zanshinmu opened 10 months ago

Zanshinmu commented 10 months ago

Checklist

What happened?

Doing a batch img2img on a large (512) number of files, python grows to over 200GB of memory used.

Steps to reproduce the problem

On a Mac, loaded SDXL 1.0 base, set up batch for 18 steps upscaling 512 to 1024, refiner model at 90%. Settings are set to cache up to 2 models. Over time, memory use grows.

What should have happened?

Memory use should not grow as models are re-used. Memory use should have hovered around 50GB.

What browsers do you use to access the UI ?

Apple Safari

Sysinfo

sysinfo-2023-12-28-07-38.json

Console logs

unavailable after MacOS force-quits python

Additional information

No response

Zanshinmu commented 10 months ago

Neverminnd, the issue appears to have been resolved by upgrading to PyTorch 2.1.2

leesenchiu commented 9 months ago

does it really work?