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

Shutdown button

Open puyebu opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. I frequently have to restart the application and it is not very comfortable to kill python.exe process every time especially if I run something else along.

Describe the solution you'd like A simple button somewhere in GUI that would initiate shutdown or just force-kill used python processes.

puyebu avatar Oct 10 '22 20:10 puyebu

I have a stop.bat file in my directory with the following code:

taskkill  /im "cmd.exe"
taskkill  /im "cmd.exe" /f

SLEEP 2
taskkill  /im "conhost.exe"
taskkill  /im "conhost.exe" /f

SLEEP 2
taskkill  /im "python.exe"
taskkill  /im "python.exe" /f

exit

Just double click on it and it'll kill the process

joshistoast avatar Oct 10 '22 23:10 joshistoast

I have a stop.bat file in my directory with the following code:

I agree that batch works but it is still killing processes with possibility of killing the ones not related to the webui. There should be standard way to turn the interface off rather than nuking processes.

puyebu avatar Oct 11 '22 10:10 puyebu

You're not happy sending ctrl-c to the terminal?

dfaker avatar Oct 12 '22 02:10 dfaker

I completely agree, but nuking it is the only thing that seems to work for me most times. Often times it gets SO stuck that sending ctrl+c does nothing.

joshistoast avatar Oct 12 '22 04:10 joshistoast

Out of all the times I have turned the application off - "CTRL+C" worked only once, I would have no problem if I could just CTRL+C it. I guess the proper ctrl+c would be an acceptable alternative to the button in gui.

puyebu avatar Oct 12 '22 06:10 puyebu

There can be some threads to wait for, and because of that a slight delay, but I've never seen a single SIGINT not work.

I'll see if I can pack something tiny in a the bottom of the settings page.

dfaker avatar Oct 12 '22 12:10 dfaker

For one thing, CTRL+C in the terminal does not clean images saved in the %TEMP% folder.

Context for those unaware: The UI saves every image generated in %TEMP%/tmpXXXXXXXX/, regardless of your folder and save settings.

DanielLaberge avatar Oct 18 '22 21:10 DanielLaberge

The UI saves every image generated in %TEMP%/tmpXXXXXXXX/, regardless of your folder and save settings.

Not just that, it creates multiple copies of generated files, and not like 2-3 duplicates - more like 20-30. I just cleaned 80+ Gb of this crap 😠

Zueuk avatar Dec 17 '22 12:12 Zueuk

A proper shutdown button is needed. A CTRL-C to the terminal can cause FS corruption if the running processes don't properly shutdown. When stable diffusion experiences FS corruption, then you get errors like this when you start webui: "UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 2: invalid start byte". Reloading stable diffusion is the only way to clear the corruption.

tkocou avatar Apr 28 '23 17:04 tkocou

Reloading stable diffusion is the only way to clear the corruption.

What does "reloading stable diffusion" mean practically in this case?

LorenzoBunino avatar May 02 '23 16:05 LorenzoBunino

@puyebu Let me know what you think about this shutdown button extension: https://github.com/EnsignMK/sd_shutdown_button

EnsignMK avatar Jul 15 '23 12:07 EnsignMK

The aforementioned extension and the API routes should be sufficient for this now. Closing.

catboxanon avatar Aug 03 '23 00:08 catboxanon