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

[Bug]: IMG TO IMG breaking for no apparent reason randomly with no loading bar or just plain not working

Open chernobog24 opened this issue 1 year ago • 3 comments

IMG TO IMG breaking for no apparent reason randomly with strange errors

What happened?

Img to img is breaking while running on the collab https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb#scrollTo=p4wj_txjP3TC. the break seems to happen differently each time and sometimes img to img still works but slower or with no progress loading bar. sometimes it says error not connected but then still makes txt to img images just fine. I wonder if I am picking a certain setting that is causing the crash I noticed it doesn't always crash and sometimes I can make several dozen img to img pictures. I have noticed this errror somewhat consistently although not every time:

ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/websockets/websockets_impl.py", line 225, in run_asgi result = await self.app(self.scope, self.asgi_receive, self.asgi_send) File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 270, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 149, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/base.py", line 24, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/gzip.py", line 26, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/exceptions.py", line 51, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 680, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 334, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 81, in app await func(session) File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 283, in app await dependant.call(**values) File "/usr/local/lib/python3.9/dist-packages/gradio/routes.py", line 436, in join_queue session_info = await websocket.receive_json() File "/usr/local/lib/python3.9/dist-packages/starlette/websockets.py", line 133, in receive_json self._raise_on_disconnect(message) File "/usr/local/lib/python3.9/dist-packages/starlette/websockets.py", line 105, in _raise_on_disconnect raise WebSocketDisconnect(message["code"]) starlette.websockets.WebSocketDisconnect: 1006

Steps to reproduce the problem

  1. Go to https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb#scrollTo=p4wj_txjP3TC
  2. Press run all all cells and then open the link that pops up
  3. attempt to use any feature in the img to img tab a few times

What should have happened?

There should be no issue running it at all.

Commit where the problem happens

It seems to happen in the image to image tab only as text to image remains fine

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

no

List of extensions

control net. lora extension.

Console logs

[AddNet] Updating model hashes...
100% 2/2 [00:00<00:00, 210.74it/s]
[AddNet] Updating model hashes...
100% 2/2 [00:00<00:00, 86.00it/s]
Loading weights [50043a7805] from /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion/modelURPM.ckpt
Creating model from config: /content/gdrive/MyDrive/sd/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/VAE/vaeftmse.safetensors
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0): 
Model loaded in 49.4s (load weights from disk: 41.1s, create model: 1.4s, apply weights to model: 2.8s, apply half(): 1.1s, load VAE: 2.1s, move model to device: 0.8s).
Running on public URL: https://ffecfff4-fc38-4e2a.gradio.live
✔ Connected
Startup time: 83.2s (import gradio: 2.8s, import ldm: 1.6s, other imports: 4.4s, list extensions: 0.3s, list SD models: 0.2s, load scripts: 2.1s, load SD checkpoint: 49.5s, create ui: 20.7s, gradio launch: 1.5s).

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/websockets/websockets_impl.py", line 225, in run_asgi
    result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 149, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/base.py", line 24, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/gzip.py", line 26, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/exceptions.py", line 51, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 680, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 334, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 81, in app
    await func(session)
  File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 283, in app
    await dependant.call(**values)
  File "/usr/local/lib/python3.9/dist-packages/gradio/routes.py", line 436, in join_queue
    session_info = await websocket.receive_json()
  File "/usr/local/lib/python3.9/dist-packages/starlette/websockets.py", line 133, in receive_json
    self._raise_on_disconnect(message)
  File "/usr/local/lib/python3.9/dist-packages/starlette/websockets.py", line 105, in _raise_on_disconnect
    raise WebSocketDisconnect(message["code"])
starlette.websockets.WebSocketDisconnect: 1006

Additional information

No additional information please comment if you have the same issue maybe we can work together to solve it.

chernobog24 avatar Mar 17 '23 02:03 chernobog24

I have the same issue. Just randomly stops working sometimes. Usually it lets me do one image and then after that nothing happens when I press the button.

JJJ-art111 avatar Mar 17 '23 20:03 JJJ-art111

Same. Vram doesn't seem to clear afterwards, requiring restart of webui.bat. I've also noticed a huge drop in resolution potential. Was able to gen up to 768x2048 a few days ago last week and now even the first generation won't go much above 512x512. I'm sometimes able to get a few in a row, but even right clicking the image during generation (something I used to do all the time), or selecting text causes instant OOM.

AmusedDiffuser avatar Mar 19 '23 16:03 AmusedDiffuser

Had any luck finding anyone who may be able to offer a solution yet?

JJJ-art111 avatar Mar 20 '23 15:03 JJJ-art111

Same for me. I tried several solutions as rolling back to a commit with a different gradio version + clearing venv, but it still persists. Does anyone have an idea how to fix this issue?

MariusKM avatar Apr 11 '23 11:04 MariusKM

This error is common in google chrome, try change and use firefox or edge, worked for me, no error. starlette.websockets.WebSocketDisconnect: 1006 solved to me

capcaverna avatar May 02 '23 21:05 capcaverna