Sygil-Dev / stable-diffusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] When SD is relaunched it switches port numbers, it should maintain the same port to preserve user parameters

JoshuaKimsey opened this issue · comments

This technically is both a bug and a feature request, but it's annoying enough I'll classify it as a bug.

When Stable Diffusion is relaunched after a CUDA OOM error, or if it is simply relaunched too quickly, it changes the port number for the web server it runs on. The default is localhost:7860, but changes to localhost7861 after a quick or forced relaunch. This is annoying because if it relaunches on the same port number, the parameters set by the user in the webui will still work once it relaunches, if it's on the same port. I already tested this and confirmed it works (I had to stop SD, relaunch it, stop it again, and then it opened back on 7860), and it would make a forced relauch less of an annoyance for someone as they won't have to set things back up for another inference.

If it is possible, the port number should definitely be made to always open on 7860 to avoid any issues with changing port numbers. If this is a harder issue to solve than just simply setting the port number manually, then perhaps have it wait to relaunch until port: 7860 is open again? In either case, it would definitely help those who are sitting near the top of their VRAM limit, and sometimes prone to getting an OOM relaunch.