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

[Bug]: gradio link won't show at launch

Open aatamakaycee opened this issue 2 years ago • 39 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

recently launch stops at 'Running on local URL: xxx ...' gradio link won't show up

Steps to reproduce the problem

run on google colab

What should have happened?

gradio link shows up to access the web ui

Commit where the problem happens

fd4461d44c7256d56889f5b5ed9fb660a859172f

What platforms do you use to access UI ?

Other/Cloud

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--share --gradio-debug --medvram --disable-safe-unpickle --xformers

Additional information, context and logs

No response

aatamakaycee avatar Jan 02 '23 06:01 aatamakaycee

I'm facing same problem. Is it Automatic problem, or Colab problem?

togaiaoi avatar Jan 02 '23 07:01 togaiaoi

I'm facing same problem. Is it Automatic problem, or Colab problem?

sadly idk, hope we can find out soon

aatamakaycee avatar Jan 02 '23 07:01 aatamakaycee

I'm facing same problem. Is it Automatic problem, or Colab problem?

having the same problem running on paperspace, so assuming not a colab exclusive issue

MBurneracc avatar Jan 02 '23 07:01 MBurneracc

How do you launch WebUI?

Spaceginner avatar Jan 02 '23 07:01 Spaceginner

How do you launch WebUI?

on colab: !COMMANDLINE_ARGS="--share --medvram --disable-safe-unpickle --xformers" REQS_FILE="requirements.txt" python launch.py

aatamakaycee avatar Jan 02 '23 07:01 aatamakaycee

This is a gradio issue. Running a code block downgrading to 3.9.0 should solve the problem:

pip install gradio==3.9.0

Thanks to user matroxl for figuring this out!

EDIT: it apparently generates another error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gradio/routes.py", line 284, in run_predict
    output = await app.blocks.process_api(
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 983, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 930, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components.py", line 3308, in postprocess
    file = processing_utils.save_pil_to_file(img, dir=self.temp_dir)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui_tempdir.py", line 18, in save_pil_to_file
    shared.demo.temp_file_sets[0] = shared.demo.temp_file_sets[0] | {os.path.abspath(already_saved_as)}
AttributeError: 'Blocks' object has no attribute 'temp_file_sets'

thelstreon avatar Jan 02 '23 07:01 thelstreon

that install didnt work for me, i tried earlier then did a clean install, and i still got error codes when i tried to generate on gradio after

rektobot avatar Jan 02 '23 07:01 rektobot

Yep. Could confirm it doesn't work in Colab.

thelstreon avatar Jan 02 '23 07:01 thelstreon

Same, is this issue with Automatic1111?

MaxTran96 avatar Jan 02 '23 08:01 MaxTran96

This is a gradio issue. Running a code block downgrading to 3.9.0 should solve the problem:

pip install gradio==3.9.0

Thanks to user matroxl for figuring this out!

EDIT: it apparently generates another error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gradio/routes.py", line 284, in run_predict
    output = await app.blocks.process_api(
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 983, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 930, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/usr/local/lib/python3.8/dist-packages/gradio/components.py", line 3308, in postprocess
    file = processing_utils.save_pil_to_file(img, dir=self.temp_dir)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui_tempdir.py", line 18, in save_pil_to_file
    shared.demo.temp_file_sets[0] = shared.demo.temp_file_sets[0] | {os.path.abspath(already_saved_as)}
AttributeError: 'Blocks' object has no attribute 'temp_file_sets'

Try doing a git check out.

Make a new cell, type [!git checkout 11d432d] (remove the brackets), and run the cell. That seems to have fixed it for me because my gradio link is working now.

Also I should note, I'm running this on the paper space configuration. This might work on Google Colab but I'm not sure.

DarthMov avatar Jan 02 '23 08:01 DarthMov

that checkout returned this: fatal: not a git repository (or any of the parent directories): .git. 🤷‍♂️

rektobot avatar Jan 02 '23 08:01 rektobot

It is works for me on colab, thank you

magicFeirl avatar Jan 02 '23 08:01 magicFeirl

where did you put the cell?

rektobot avatar Jan 02 '23 08:01 rektobot

You should enter the sd-webui dir at first, e.g.

that checkout returned this: fatal: not a git repository (or any of the parent directories): .git. 🤷‍♂️

You should enter the webui dir at first. e.g.: %cd /content/stable-diffusion-webui

magicFeirl avatar Jan 02 '23 08:01 magicFeirl

👍🏻

rektobot avatar Jan 02 '23 08:01 rektobot

AttributeError: 'Blocks' object has no attribute 'temp_file_sets'

getting the same error

AttributeError: 'Blocks' object has no attribute 'temp_file_sets'

screan avatar Jan 02 '23 09:01 screan

in colab

Type "!git checkout 11d432d" after "%cd stable-diffusion-webui"

MysticKago avatar Jan 02 '23 10:01 MysticKago

got this error instead ImportError: cannot import name 'ui_components' from 'modules' (unknown location)

ThanapatSornsrivichai avatar Jan 02 '23 10:01 ThanapatSornsrivichai

Nothing seems to work for me. Not even the !git checkout solution.

On collab: error: pathspec '11d432d' did not match any file(s) known to git.

JeleLele3 avatar Jan 02 '23 12:01 JeleLele3

No longer appears for me either. Running with --share argument.

mflux avatar Jan 02 '23 13:01 mflux

This seems to be a gradio problem. gradio changed the network method in 3.13, but probably due to a fault, it can no longer get the URL from the connection and freezes at this location.

https://github.com/gradio-app/gradio/blob/58b1a074ba342fe01445290d680a70c9304a9de1/gradio/tunneling.py#L93-L97

The countermeasure is to change the WEB UI to the one used before gradio 3.15 was introduced ( https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/11d432d92d63660c516540dcb48faac87669b4f0 ) before gradio 3.15 was introduced. However, this method may cause conflicts with the Extension.

tsukimiya avatar Jan 02 '23 14:01 tsukimiya

This seems to be a gradio problem. gradio changed the network method in 3.13, but probably due to a fault, it can no longer get the URL from the connection and freezes at this location.

https://github.com/gradio-app/gradio/blob/58b1a074ba342fe01445290d680a70c9304a9de1/gradio/tunneling.py#L93-L97

The countermeasure is to change the WEB UI to the one used before gradio 3.15 was introduced ( 11d432d ) before gradio 3.15 was introduced. However, this method may cause conflicts with the Extension.

why this issue only appears today when gradio recent update was days ago?

aatamakaycee avatar Jan 02 '23 14:01 aatamakaycee

Thanks guys, it worked for me: (insert a new cell) %cd /content/stable-diffusion-webui !git checkout 11d432d

nekrophiliaki avatar Jan 02 '23 14:01 nekrophiliaki

@aatamakaycee gradio connects to the host:port described in https://api.gradio.app/v2/tunnel-request and gets the URL ( (hash).gradio.live ) to use. However, there has been no response from this host since about 2023-01-02 06:20:00 (UTC), and the URL cannot be obtained.

tsukimiya avatar Jan 02 '23 14:01 tsukimiya

I got the same issue for my local host, it was working fine two days ago as well as yesterday, today suddenly the gradio link cannot show up. Using - - share gives me an error saying

Could not create share link, please check your internet connection.

I did not modify any configuration for my local machine here. Using - - listen works

zhongyiwei avatar Jan 02 '23 15:01 zhongyiwei

I had this working remotely on Vast.ai, but the recent update to Gradio (3.9 to 3.15) makes it so that the Public URL no longer shows, only the local URL. Anyone with any ideas?

Gradio 3.9

Running on local URL:  http://127.0.0.1:7860/
Running on public URL: https://e7cc2ecf76a3f095.gradio.app/
This share link expires in 72 hours.

Gradio 3.15

Running on local URL:  http://127.0.0.1:7860/

caniyabanci76 avatar Jan 02 '23 19:01 caniyabanci76

it's working again

robledomaturana avatar Jan 02 '23 20:01 robledomaturana

Ran into this issue just now, but I resolved the issue by downgrading gradio.

Setting up a public link... we have recently upgraded the way public links are generated. If you encounter any problems, please report the issue and downgrade to gradio version 3.13.0

Based on this Gradio message, it looks like downgrading to 3.13.0 will resolve the issue:

/path/to/stable-diffusion-webui/venv/bin/python3 -m pip install gradio==3.13.0

ProGamerGov avatar Jan 02 '23 21:01 ProGamerGov

@aatamakaycee gradio connects to the host:port described in https://api.gradio.app/v2/tunnel-request and gets the URL ( (hash).gradio.live ) to use. However, there has been no response from this host since about 2023-01-02 06:20:00 (UTC), and the URL cannot be obtained.

so we need to wait for gradio fix the issue rather than AUTOMATIC's team?

aatamakaycee avatar Jan 02 '23 22:01 aatamakaycee

it's working again

I don't think so, even running Gradio's "Hello World" example from https://gradio.app/quickstart/ hangs. So yes, you need to use the version workaround...

pazkero avatar Jan 02 '23 22:01 pazkero