stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Reduce memory usage when merging and UX improvements.
- 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.

- 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.
tested and didnt see a problem with it
Analogue solution provided on #5404