lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.8k stars 186 forks source link

[Bug]: Starlette #182

Open mageofthesands opened 1 year ago

mageofthesands commented 1 year ago

Is there an existing issue for this?

What happened?

I keep encountering an error when I start up Stable Diffusion DirectML. The exact messages change, but it seems to have something to do with h11 or starlette. It's rather consistent on that part. I don't even know what the bug does, only that the terminal keeps complaining.

Steps to reproduce the problem

Run webui-user

What should have happened?

No complaints from terminal.

Version or Commit where the problem happens

version:  •  python: 3.10.6  •  torch: 2.0.0+cpu  •  xformers: N/A  •  gradio: 3.29.0  •  checkpoint: 670e89364d

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

AMD GPUs (RX 6000 above)

Cross attention optimization

V1

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--autolaunch --medvram --skip-torch-cuda-test --upcast-sampling --disable-nan-check --sub-quad-q-chunk-size 512 --sub-quad-kv-chunk-size 512 --sub-quad-chunk-threshold 80 --no-half-vae --opt-split-attention-v1 --api --theme dark

List of extensions

starlette4

Console logs

Data shape for DDIM sampling is (1, 4, 96, 64), eta 0.0                                                                                                                                                      | 0/4 [00:00<?, ?it/s]
Running DDIM Sampling with 20 timesteps
DDIM Sampler:   0%|                                                                                                                                                                                        | 0/20 [00:00<?, ?it/s]API error: POST: http://127.0.0.1:7860/run/predict {'error': 'LocalProtocolError', 'detail': '', 'body': '', 'errors': "Can't send data when our state is ERROR"}
╭───────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────╮
│ H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py:162 in __call__                                                                                             │
│                                                                                                                                                                                                      │
│ H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\base.py:109 in __call__                                                                                               │
│                                                                                                                                                                                                      │
│                                                                                       ... 7 frames hidden ...                                                                                        │
│                                                                                                                                                                                                      │
│ H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py:468 in send                                                                                                             │
│                                                                                                                                                                                                      │
│   467 │   │   """                                                                                                                                                                                    │
│ ❱ 468 │   │   data_list = self.send_with_data_passthrough(event)                                                                                                                                     │
│   469 │   │   if data_list is None:                                                                                                                                                                  │
│                                                                                                                                                                                                      │
│ ╭───────────────────────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ event = Response(status_code=200, headers=<Headers([(b'date', b'Mon, 03 Jul 2023 11:39:21 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4691'), (b'content-type', b'application/json'),  │ │
│ │         (b'content-encoding', b'gzip'), (b'vary', b'Accept-Encoding'), (b'x-process-time', b'822.3881')])>, http_version=b'1.1', reason=b'OK')                                                   │ │
│ │  self = <h11._connection.Connection object at 0x0000019213258AC0>                                                                                                                                │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                                                      │
│ H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py:483 in send_with_data_passthrough                                                                                       │
│                                                                                                                                                                                                      │
│   482 │   │   if self.our_state is ERROR:                                                                                                                                                            │
│ ❱ 483 │   │   │   raise LocalProtocolError("Can't send data when our state is ERROR")                                                                                                                │
│   484 │   │   try:                                                                                                                                                                                   │
│                                                                                                                                                                                                      │
│ ╭───────────────────────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ event = Response(status_code=200, headers=<Headers([(b'date', b'Mon, 03 Jul 2023 11:39:21 GMT'), (b'server', b'uvicorn'), (b'content-length', b'4691'), (b'content-type', b'application/json'),  │ │
│ │         (b'content-encoding', b'gzip'), (b'vary', b'Accept-Encoding'), (b'x-process-time', b'822.3881')])>, http_version=b'1.1', reason=b'OK')                                                   │ │
│ │  self = <h11._connection.Connection object at 0x0000019213258AC0>                                                                                                                                │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
LocalProtocolError: Can't send data when our state is ERROR
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\fastapi\applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\base.py", line 109, in __call__
    await response(scope, receive, send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 270, in __call__
    async with anyio.create_task_group() as task_group:
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 597, in __aexit__
    raise exceptions[0]
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 273, in wrap
    await func()
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\base.py", line 134, in stream_response
    return await super().stream_response(send)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\responses.py", line 255, in stream_response
    await send(
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\starlette\middleware\errors.py", line 159, in _send
    await send(message)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 512, in send
    output = self.conn.send(event)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 468, in send
    data_list = self.send_with_data_passthrough(event)
  File "H:\stable-diffusion-webui-directml\venv\lib\site-packages\h11\_connection.py", line 483, in send_with_data_passthrough
    raise LocalProtocolError("Can't send data when our state is ERROR")
h11._util.LocalProtocolError: Can't send data when our state is ERROR
tensor(0.0082, device='privateuseone:0', dtype=torch.float16)

Additional information

starletts1 starlette2 starlette3