0

My local Stable-Diffusion installation was working fine. One day after starting webui-user.bat the command window got stuck after this:

venv "...\venv\Scripts\Python.exe" Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89 Installing requirements Launching Web UI with arguments: No module 'xformers'. Proceeding without it. Loading weights [cc6cb27103] from ...\StableDiffusion\models\Stable-diffusion\v1-5-pruned-emaonly.ckpt Creating model from config: ...\StableDiffusion\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Applying cross attention optimization (Doggettx). Textual inversion embeddings loaded(0): Model loaded in 4.7s (load weights from disk: 2.2s, create model: 0.3s, apply weights to model: 0.4s, apply half(): 0.4s, move model to device: 0.4s, load textual inversion embeddings: 1.0s).

Nothing happens after this. Just doesn't continue (doesn't show the ip for the web interface). I think I uninstalled/installed Python again before this happened. But not sure anymore. I didn't change the webui-user.bat.

Any ideas?

sobo
  • 887
  • 8
  • 7

2 Answers2

0

Same issue, I have found a quickfix for now : After Ctrl-C, python tells us where the program was interrupted by the SIGKILL signal :

Model loaded in 2.5s (load weights from disk: 0.7s, create model: 0.3s, apply weights to model: 0.5s, apply half(): 0.4s, move model to device: 0.4s). ^CInterrupted with signal 2 in <frame at 0xafb7540, file '/home/geoffrey/stable-diffusion-webui/webui.py', line 260, code wait_on_server

We can see that webui.py stopped its execution at line 260. When looking at this line we can see this function :

def wait_on_server(demo=None):
    while(1):
        time.sleep(0.5)
        if shared.state.need_restart:
            shared.state.need_restart = False
            time.sleep(0.5)
            demo.close()
            time.sleep(0.5)

            modules.script_callbacks.app_reload_callback()
            break

So the installation script is clearly stuck in this while 1 loop. To fix this, I added a global boolean variable to the script to only restart the ui once at launch, and leave it alone all the next times :

launched = False

def wait_on_server(demo=None):
    global launched
    while(1):
        time.sleep(0.5)
        if shared.state.need_restart or launched == False:
            shared.state.need_restart = False
            time.sleep(0.5)
            demo.close()
            time.sleep(0.5)

            modules.script_callbacks.app_reload_callback()
            launched = True
            break

I don't really know if this is going to cause some trouble later, but it looks like I can generate pictures by prompts (you just have to wait for the server to launch and connect at the address printed in the terminal) :D

Good luck guys !

Quack E. Duck
  • 594
  • 1
  • 4
  • 20
  • Hi, Geoffrey! Welcome to Stack Overflow. It's preferred on this site to use code blocks instead of images when referencing sample code in your question or answer - see the discussion here: https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors I suggested an edit which formats your code samples in the recommended way, but this won't be visible until you or someone else approves it. – Quack E. Duck May 19 '23 at 22:31
0

Pay close attention to the messages that webui.bat throws out while it is running. If there are error messages and a suggestion about how to fix the error, follow the directions and run webui.bat again.
Zaffer

Zaffer
  • 17
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 03 '23 at 06:39