Dealing with Stable Diffusion and Standby / Power Settings

May 22, 2023

I have been having fun with stable diffusion but it doesn't have that setting that stops your computer from going into standby mode while it's running.  That best solution I've been able to come up with so far is modifying the batch file webui-user.bat:

powercfg -change -standby-timeout-ac 0
@echo off

set GIT=

call webui.bat
powercfg -change -standby-timeout-ac 10

The first and last lines set the standby time out.  When it's set to 0 it will never shut off, and 10 sets your computer to automatically go into standby after 10 minutes.  You can change this number to whatever you want.

One important note: When hit “Ctrl c" to stop program, it will ask “Terminate batch job (Y/N)?”

Make sure you press no, or ‘n’ here.  This will continue shutting down of stable diffusion, but if you hit ‘y’, it will exit the batch file before it gets to the last line to set the timeout back to 10.  

Back to Home