stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Reduce memory usage when merging and UX improvements.

Open DarioFT opened this issue 3 years ago • 1 comments

  • I did a few tweaks to reduce memory usage by not loading all models at the same time when merging using "Add diference", by loading and unloading the models when appropiate.

On my PC with 16GB of RAM, this change implies now I can merge the models whereas before it would get OOM resulting in the operating system crashing. As you can see with the attached graphic even after the changes the process still utilizes all available RAM, but the process finishes succesfully now.

Windows memory profile

  • I've streamlined the cases of merging models by refactoring some code logic to avoid getting errors in Gradio mostly by randomly pre-selecting required models to merge as potential candidates and also by checking if the Interpolation method selected by the user makes sense depending on the model inputs.

DarioFT avatar Nov 02 '22 06:11 DarioFT

tested and didnt see a problem with it

cluder avatar Nov 09 '22 18:11 cluder

Analogue solution provided on #5404

DarioFT avatar Dec 15 '22 01:12 DarioFT