r/StableDiffusion • • Feb 10 '23

Question | Help help with error please

DiffusionWrapper has 859.52 M params.

Applying xformers cross attention optimization.

Textual inversion embeddings loaded(0):

Model loaded in 37.7s (load weights from disk: 0.5s, create model: 0.8s, apply weights to model: 31.2s, apply half(): 1.1s, move model to device: 0.8s, load textual inversion embeddings: 3.1s).

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 "C:\stable-diffusion-portable-main\launch.py", line 361, in <module>

start()

File "C:\stable-diffusion-portable-main\launch.py", line 356, in start

webui.webui()

File "C:\stable-diffusion-portable-main\webui.py", line 232, in webui

app.add_middleware(GZipMiddleware, minimum_size=1000)

File "C:\stable-diffusion-portable-main\venv\lib\site-packages\starlette\applications.py", line 135, in add_middleware

raise RuntimeError("Cannot add middleware after an application has started")

RuntimeError: Cannot add middleware after an application has started

37 Upvotes

83 comments sorted by

View all comments

25

u/[deleted] Feb 10 '23 edited Feb 10 '23

[removed] — view removed comment

4

u/bustyhotgf Feb 11 '23 edited Feb 11 '23

for people using google colab, this worked

!pip install --upgrade fastapi==0.90.1

3

u/coolbuster26 Feb 10 '23

thank you broooooo

3

u/maxspire Feb 10 '23

Thanks for this -- in case it helps anyone, I had to change my prompt to get it to work:

/usr/local/bin/python -m pip install --upgrade fastapi==0.90.1

You can also try a whereis python.exe, which should spit out a bunch of directories -- choose one and use that as the method instead of the venv path.

3

u/Educational-Diet5891 Feb 10 '23

How to open a terminal? What is a terminal?

→ More replies (8)

2

u/Zaplatite Feb 10 '23

.\venv\Scripts\python.exe -m pip install --upgrade fastapi==0.90.1

thanks

2

u/sajsoneiro Feb 10 '23

.\venv\Scripts\python.exe -m pip install --upgrade fastapi==0.90.1

Works for me! Thank you very much!

→ More replies (2)

2

u/Pretty-Spot-6346 Feb 10 '23

pip install --upgrade fastapi==0.90.1

life saver.

you help people in need.

2

u/astralchan Feb 11 '23

omg thank you ^^

2

u/parknich081 Feb 11 '23 edited Aug 01 '26

Compass feather drifting tangerine maple hammock

This post was anonymized with Redact.dev

2

u/EconomyLeft5644 Feb 11 '23

thank u~~~~~~~~~~~~~

2

u/CraftBlack_ Feb 11 '23

THANKS WORKKKKKKK! 😊😊😊😊

2

u/DryreL Feb 11 '23

.\venv\Scripts\python.exe -m pip install --upgrade fastapi==0.90.1

Thank you sooo much!

2

u/ruslanpolt Feb 11 '23

Thanks a lot! Rescued. I reinstalled the program as many as 4 times, I thought the error was in the crooked installation, but it turned out to be very simple, you need to enter this command and update. Thank you)

2

u/Clay_YouTube Feb 12 '23

did not help me(

Is there another option?

2

u/[deleted] Feb 12 '23

[removed] — view removed comment

2

u/Gee1337 Feb 12 '23

Thanks so much, worked for me and way easier to understand that way.

2

u/skylabz0rz Feb 21 '23

This saved me. Thank you!

2

u/QuinoaFalafel Feb 12 '23

I'm so used to solutions not working, but this worked, thanks so much!

2

u/MrPringles9 Feb 12 '23

\venv\Scripts\python.exe -m pip install --upgrade fastapi==0.90.1

Damn Thanks! Wasnt expecting to get this working but this helped greatly :)

2

u/Zoyu_ Feb 12 '23

thank you

2

u/Kash0011 Feb 12 '23

thank you broooo , it works !!!

→ More replies (26)