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

Please reinstall xformers. How?

Open Maximb1985 opened this issue 1 year ago • 12 comments

Hello!

Generating images has become impossible lately. Could you please tell me how to install it (xformers) and most importantly where? I'm at a grandfather level in all of this :) I use google collab. Thanks!

I looked in other posts and made changes to webui-user.bat notepad, but nothing changed. I didn't find any other way or didn't understand how to do it. Plus I use a translator :)

Maximb1985 avatar Dec 16 '23 11:12 Maximb1985

Some update on the Googlecolab side broke tons of colabs need to wait until we find a way to fix that. I am not a python guy at all so right now I am at the mercy of others.

gimpycpu avatar Dec 16 '23 11:12 gimpycpu

That's too bad :( So we'll have to wait. I just usually use paperspace when there are problems with here, but today paperspace doesn't work either. So I'm confused. Thanks.

Maximb1985 avatar Dec 16 '23 11:12 Maximb1985

below is the solution that helped, I'll leave it here, in case someone needs it (I searched in old and new chats):

" In my environment, I added the following code to the beginning of the notebook and ran it, and StableDiffusion ran as before. I also made some modifications to the October Tips: [https://github.com/https://github.com/TheLastBen/fast-stable-diffusion/issues/2615] "

!pip install lmdb !pip install torch==2.1.0+cu118 torchvision==0.16.0+cu118 torchaudio==2.1.0 torchtext==0.16.0+cpu torchdata==0.7.0 --index-url https://download.pytorch.org/whl/cu118

Maximb1985 avatar Dec 16 '23 12:12 Maximb1985

Hi! It not work for me! Any updates?

daniilplotnikov avatar Dec 16 '23 14:12 daniilplotnikov

Try adding these two blocks after the "models load/download" block (each line a block) pip uninstall xformers (On this block, after running it, remember to click on the white space after the line "Proceed? (y/n)?" and then type "y" and then click enter. pip install xformers wqd

danggphamm avatar Dec 16 '23 16:12 danggphamm

I have found the solution: !pip install lmdb !pip install torch==2.1.2+cu121 --index-url https://download.pytorch.org/whl/cu121 !pip install -U clean-fid torchaudio torchdata torchvision torchtext !pip install xformers --force --index-url https://download.pytorch.org/whl/cu121 !pip install -U bitsandbytes

I've tried all these commands, I don't know what exactly helped

daniilplotnikov avatar Dec 16 '23 16:12 daniilplotnikov

Every week, instead of generating pictures, I have to dance with a notepad for 1 hour, it's sh///t

ControlNet preprocessor location: /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads 2023-12-16 17:43:04,550 - ControlNet - INFO - ControlNet v1.1.422 2023-12-16 17:43:18,183 - ControlNet - INFO - ControlNet v1.1.422 Loading weights [fe7578cb5e] from /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion/realisticVisionV60B1_v60B1VAE.safetensors ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 273, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 184, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 84, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 79, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 718, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 66, in app response = await func(request) File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 227, in app solved_result = await solve_dependencies( File "/usr/local/lib/python3.10/dist-packages/fastapi/dependencies/utils.py", line 545, in solve_dependencies solved = await run_in_threadpool(call, **sub_values) File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 41, in run_in_threadpool return await anyio.to_thread.run_sync(func, *args) File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( AttributeError: partially initialized module 'anyio._backends._asyncio' has no attribute 'run_sync_in_worker_thread' (most likely due to a circular import) ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 78, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 273, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 184, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 84, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 79, in call raise exc File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 718, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 66, in app response = await func(request) File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 227, in app solved_result = await solve_dependencies( File "/usr/local/lib/python3.10/dist-packages/fastapi/dependencies/utils.py", line 545, in solve_dependencies solved = await run_in_threadpool(call, **sub_values) File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 41, in run_in_threadpool return await anyio.to_thread.run_sync(func, *args) File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( AttributeError: partially initialized module 'anyio._backends._asyncio' has no attribute 'run_sync_in_worker_thread' (most likely due to a circular import) Creating model from config: /content/gdrive/MyDrive/sd/stable-diffusion-webui/configs/v1-inference.yaml Running on public URL: https://bcb8cfcc40292ab36d.gradio.live/ ✔ Connected Startup time: 338.8s (launcher: 1.9s, import torch: 18.9s, import gradio: 2.1s, setup paths: 55.6s, import ldm: 1.8s, initialize shared: 15.4s, other imports: 77.8s, setup codeformer: 23.2s, setup gfpgan: 1.0s, list SD models: 4.4s, load scripts: 76.6s, load upscalers: 1.6s, initialize extra networks: 8.7s, scripts before_ui_callback: 0.1s, create ui: 35.2s, gradio launch: 14.3s, add APIs: 0.1s). The future belongs to a different loop than the one specified as the loop argument The future belongs to a different loop than the one specified as the loop argument The future belongs to a different loop than the one specified as the loop argument The future belongs to a different loop than the one specified as the loop argument The future belongs to a different loop than the one specified as the loop argument Applying attention optimization: xformers... done. Model loaded in 84.3s (load weights from disk: 55.9s, create model: 13.4s, apply weights to model: 14.2s, calculate empty prompt: 0.5s). The future belongs to a different loop than the one specified as the loop argument

ApchDio avatar Dec 16 '23 17:12 ApchDio

Check this out https://github.com/TheLastBen/fast-stable-diffusion/issues/2615#issuecomment-1858931505

paradoxtown avatar Dec 16 '23 21:12 paradoxtown

Check this out #2615 (comment)

Just tried solution #2 in fast-dreambooth on Colab, FWIW, and CUDA still fails as soon as text encoder training begins.

robempire avatar Dec 16 '23 21:12 robempire

Thank you @daniilplotnikov it works man

pendtiumpraz avatar Dec 16 '23 22:12 pendtiumpraz

Hi all Please read the next thread above for a solution

Azura-13 avatar Dec 16 '23 23:12 Azura-13

#Update python version to 3.9

!sudo apt-get update !sudo apt-get install python3.9 !sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 !sudo update-alternatives --set python3 /usr/bin/python3.9

!pip install lmdb !pip install torch==2.1.2+cu121 --index-url https://download.pytorch.org/whl/cu121 !pip install -U clean-fid torchaudio torchdata torchvision torchtext !pip install xformers --force --index-url https://download.pytorch.org/whl/cu121 !pip install -U bitsandbytes

Add these line of code just above Start Stable Diffusion. It worked for me, might help others too.

naman2403 avatar Dec 18 '23 07:12 naman2403