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

[Bug]: Launching with --nowebui does not seem to correctly initialize the API

Open QuantumToasted opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

Launching webui-user.bat with COMMANDLINE_ARGS=--nowebui --listen does not seem to properly initialize the API. The last two lines in console don't indicate any weirdness or problems from what I can tell:

Running on local URL:  http://0.0.0.0:7860
To create a public link, set `share=True` in `launch()`.

Below is a screenshot of me attempting to query 127.0.0.1:7860/sdapi/v1/txt2img in Postman: image

Launching with commandline arguments --api --listen does not cause this problem, but I am looking to not run the web UI at all.

Steps to reproduce the problem

Modify webui-user.bat - namely the COMMANDLINE_ARGS line to --nowebui --listen, and then run it.

What should have happened?

The API should function as intended.

Based on webui.py:

if __name__ == "__main__":
    if cmd_opts.nowebui:
        api_only()
    else:
        webui()

If the --nowebui argument is specified, api_only() is called instead of webui() which based on the method it calls, is intended to initialize and launch the API.

Commit where the problem happens

737eb28faca8be2bb996ee0930ec77d1f7ebd939

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

`--nowebui --listen`

Additional information, context and logs

No response

QuantumToasted avatar Oct 27 '22 17:10 QuantumToasted

Posting here since it's related:

I can't even get --nowebui to stop the web UI from starting up. The flag doesn't seem to work, since I can open it at http://localhost:7860/ just like normal. Am I doing something wrong?

Keavon avatar Nov 02 '22 23:11 Keavon

Should be fixed now.

mezotaken avatar Jan 16 '23 15:01 mezotaken

Also double check the port that --nowebui opens on. Mine is different than when i use --api. I missed that in my code and spent a few min scratching my head.

owardlaw avatar Mar 25 '24 06:03 owardlaw