Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Cannot add middleware after an application has started #8

Closed
manuroboros opened this issue Feb 10, 2023 · 13 comments
Closed

Comments

@manuroboros
Copy link

Hi, first of all, thanks for these amazing tools. I've been using them for around a week with great results.

After testing a few, dreamlike is the one I enjoy the most for my goals. I don't know if I'm the only one, but using img-to-img (I use my own designs to get more precise results) the most I can go is 1024x1024 and 80 Sampling Steps. Even with that config it usually freezes, the image never appears and I have to close the window and open gradio link again. Maybe someone knows how to solve this or at least access the produced files?

The main problem is I can't start it anymore. I tried to use another account and to download the file again and start from scratch, but after gradio link shows, this message appears below:

"This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces
Traceback (most recent call last):
File "launch.py", line 360, in
start()
File "launch.py", line 355, in start
webui.webui()
File "/content/stable-diffusion-webui/webui.py", line 223, in webui
app.add_middleware(GZipMiddleware, minimum_size=1000)
File "/usr/local/lib/python3.8/dist-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
Killing tunnel 127.0.0.1:7860 <> https://6fca7fd8-7a19-4606.gradio.live"

If I try to use the link, "No interface is running right now". Anyone knows how to solve this? As it is a very simple process, I don't know where the problem is... I followed this tutorial from Nolan Aatama and it worked until this morning: https://www.youtube.com/watch?v=AX9Cl7LR4Sg

@manuroboros
Copy link
Author

It looks like it's a problem with the API and it's happening to everybody right now:AUTOMATIC1111/stable-diffusion-webui#7714

It seems like it's resolved downgrading to 0.90.1, but I don't know how to do that with the method we're using. Any help?

@Meldoner
Copy link

In colab add line !pip install --upgrade fastapi==0.90.1
before %cd line

@dealnicolas
Copy link

dealnicolas commented Feb 10, 2023

thanks Meldoner !!!!

@ShiroTakiaki
Copy link

ShiroTakiaki commented Feb 11, 2023

thanks Meldoner !!!!

I'm sorry, but i want to ask you. I'm trying to use the command which sent Meldoner, but it says i didn't got "!pip" installed on. What should i do?

I need it because i still have " raise RuntimeError("Cannot add middleware after an application has started")
RuntimeError: Cannot add middleware after an application has started" problem

@ShiroTakiaki
Copy link

In colab add line !pip install --upgrade fastapi==0.90.1 before %cd line

Mister, can you help me please?

Мистер, можете ли Вы помочь мне, пожалуйста?

@Meldoner
Copy link

nolanaatama has already fixed that, just download a new .ipynb file

@ShiroTakiaki
Copy link

ShiroTakiaki commented Feb 11, 2023

nolanaatama has already fixed that, just download a new .ipynb file

Какой из его файлов? Там 4 репозитория.

И куда их устанавливать? Я просто качал по англ гайду и просто копировал файлы из чужого репозитория в папку и всё, так что не понимаю что и как.

@Meldoner
Copy link

nolanaatama has already fixed that, just download a new .ipynb file

Какой из его файлов? Там 4 репозитория.

И куда их устанавливать? Я просто качал по англ гайду и просто копировал файлы из чужого репозитория в папку и всё, так что не понимаю что и как.

In this repository

@ShiroTakiaki
Copy link

ShiroTakiaki commented Feb 11, 2023

nolanaatama has already fixed that, just download a new .ipynb file

Какой из его файлов? Там 4 репозитория.
И куда их устанавливать? Я просто качал по англ гайду и просто копировал файлы из чужого репозитория в папку и всё, так что не понимаю что и как.

In this repository

you just gave link to him. he got 4 files, and i can not understand which i need download and where should i save them Also i jsut can't dowload it

@Meldoner
Copy link

Meldoner commented Feb 11, 2023

you just gave link to him. he got 4 files, and i can not understand which i need download and where should i save them Also i jsut can't dowload it

brooo, this discussion is in the repository https://github.com/nolanaatama/sd-1click-colab
it's written at the top

@DizainStudio
Copy link

DizainStudio commented Feb 11, 2023

It does not work for the second day or wait or go to the root folder stable-diffusion-webui-master
In the address bar, type the cmd command

In the window that opens, prescribe this:

venv\scripts\pip install --upgrade fastapi==0.90.1

Then just start - webui-user again

@nolanaatama
Copy link
Owner

sorry for not really active on this repositories mates.
I'll try to login to github more often from now on.

the setups already been updated to fix recent middleware issue.

regarding the hi.res and batch count/size bug, I tried to find the solution, but can't get it work.
honestly, I'm not an expert at coding, and if anyone have the solution I'll be interested to hear it from you.
I'll try to update the setup each week with the newest commit from AUTO1111 repo, and hope we could get a new version that works well with all the features.

@ShiroTakiaki
Copy link

how do i install Lora and other things in stable diffusion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants