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

[Bug]: --api arg breaks it all?

Open cibernicola opened this issue 3 years ago • 4 comments
trafficstars

Is there an existing issue for this?

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

What happened?

I wanted to test this new feature: https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/4195

When adding the --api parameter in the startup arguments to test it, I get this error:

`Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Traceback (most recent call last): File "launch.py", line 249, in start_webui() File "launch.py", line 244, in start_webui webui.webui() File "L:\StableDiffussionWebUI\webui.py", line 147, in webui create_api(app) File "L:\StableDiffussionWebUI\webui.py", line 97, in create_api from modules.api.api import Api File "L:\StableDiffussionWebUI\modules\api\api.py", line 8, in from modules.api.models import * File "L:\StableDiffussionWebUI\modules\api\models.py", line 111, in class TextToImageResponse(BaseModel): File "L:\StableDiffussionWebUI\modules\api\models.py", line 112, in TextToImageResponse images: list[str] = Field(default=None, title="Image", description="The generated image in base64 format.") TypeError: 'type' object is not subscriptable`

Steps to reproduce the problem

  1. add --api parameter in the startup arguments
  2. Launch webui just watch

What should have happened?

Normal application startup

Commit where the problem happens

d98eacea40c7a40227f36dbea9cf92f90489310b

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

No response

Command Line Arguments

--api

Additional information, context and logs

No response

cibernicola avatar Nov 03 '22 09:11 cibernicola

see https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4206

BlinkDL avatar Nov 03 '22 10:11 BlinkDL

I managed to change the python version, turns out my installation was a little veird and got buggy. @super3 change it to 3.10, that will do the trick, if it doesnt change try removing the venv folder, let it install it all again

Lalimec avatar Nov 04 '22 22:11 Lalimec

Getting the exact same issue on Ubuntu 20.04.5 LTS running Python 3.8.10.

The changes from @7flash on https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4245 didn't solve the issue for me.

super3 avatar Nov 05 '22 00:11 super3

@Lalimec Deleting the venv was the key. Much thanks for your help.

super3 avatar Nov 05 '22 01:11 super3