antis0007 / sd-webui-multiple-hypernetworks

GNU General Public License v3.0
97 stars 12 forks source link

Model weights keep unloading and reloading #1

Closed Lumoria closed 1 year ago

Lumoria commented 1 year ago

After each generation the model weights get unloaded and have to reload after every generation until a memory leak freezes the system completely during reloading. I'm running on an RTX 3080ti.

antis0007 commented 1 year ago

Hello @Lumoria! I believe I fixed the issue in the must recent commit. The script was unnecessarily reloading model weights for every generation, so I commented out that line. It was only there because the undo_hijack function did the same in the original code, however that wasn't meant to be called on every generation. If you have a chance, please check and see if the issue persists, thanks!

antis0007 commented 1 year ago

Update: I found another issue, patched in a fix.

Realized that the script would not unload the custom functions, meaning that you couldn't disable multiple hypernetworks. The solution for now is a "reset" button to use once you're finished with using the script, to reload the model and reset the original optimizations.

There may still be issues with generating with 8GB VRAM at higher resolutions, I'll be looking into adding adding an xformers optimized version of the same custom function.