AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.89k stars 26.93k forks source link

[Bug]: New install on windows and the launch failed #9576

Open shawhu opened 1 year ago

shawhu commented 1 year ago

Is there an existing issue for this?

What happened?

git clone the repo and execute the webui-user.bat and the launch failed.

Problem is, I've successfully installed this many times. With no problem at all.

Steps to reproduce the problem

on windows 10. command prompt

type

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui execute the webui-user.bat and it failed

What should have happened?

it should launch.

Commit where the problem happens

22bcc7be428c94e9408f589966c2040187245d81

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

Didn't add anything, just executed the one cloned with git

List of extensions

Nothing, it's a new clone

Console logs

error log

[notice] A new release of pip available: 22.2.1 -> 23.0.1
[notice] To update, run: C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip
Installing gfpgan
Installing clip
Installing open_clip
Installing requirements for CodeFormer
Installing requirements for Web UI
Launching Web UI with arguments:
Traceback (most recent call last):
  File "C:\stable-diffusion-webui\venv\lib\site-packages\httpx\_urlparse.py", line 339, in normalize_port
    port_as_int = int(port)
ValueError: invalid literal for int() with base 10: ':1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\stable-diffusion-webui\launch.py", line 356, in <module>
    start()
  File "C:\stable-diffusion-webui\launch.py", line 347, in start
    import webui
  File "C:\stable-diffusion-webui\webui.py", line 25, in <module>
    import gradio
  File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 32, in <module>
    from gradio import media_data, processing_utils, utils
  File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 25, in <module>
    from gradio import utils
  File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 555, in <module>
    class AsyncRequest:
  File "C:\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 575, in AsyncRequest
    client = httpx.AsyncClient()
  File "C:\stable-diffusion-webui\venv\lib\site-packages\httpx\_client.py", line 1408, in __init__
    self._mounts: typing.Dict[URLPattern, typing.Optional[AsyncBaseTransport]] = {
  File "C:\stable-diffusion-webui\venv\lib\site-packages\httpx\_client.py", line 1409, in <dictcomp>
    URLPattern(key): None
  File "C:\stable-diffusion-webui\venv\lib\site-packages\httpx\_utils.py", line 397, in __init__
    url = URL(pattern)
  File "C:\stable-diffusion-webui\venv\lib\site-packages\httpx\_urls.py", line 113, in __init__
    self._uri_reference = urlparse(url, **kwargs)
  File "C:\stable-diffusion-webui\venv\lib\site-packages\httpx\_urlparse.py", line 246, in urlparse
    parsed_port: typing.Optional[int] = normalize_port(port, scheme)
  File "C:\stable-diffusion-webui\venv\lib\site-packages\httpx\_urlparse.py", line 341, in normalize_port
    raise InvalidURL("Invalid port")
httpx.InvalidURL: Invalid port
Press any key to continue . . .

Additional information

No response

shawhu commented 1 year ago

One more piece of information

I do have a working installation. And by comparing the two, I've found that the dependency httpx has been upgraded from 0.23.3 to 0.24. By deleting the new one and replaced it with httpx-0.23.3 (in my old installation folder), problem fixed. It launched successfully.

jony4 commented 1 year ago

same error

httpx.InvalidURL: Invalid port
niwaguan commented 1 year ago

+1

Fezaries commented 1 year ago

+1

Orion-zhen commented 1 year ago

same error on Ubuntu 22.04LTS I tested both httpx-0.23.3 and httpx-0.24, none of them worked.

shawhu commented 1 year ago

I hope this get fixed soon, it's a BLOCKing issue. The installation will fail 100%. It should be put on the priority list...

egoeyre commented 1 year ago

try to pip install httpx==0.23.0

Orion-zhen commented 1 year ago

pip install httpx==0.23.0 didn't work. however I noticed that if you just igrone the error and run python3 webui.py, it can launch just as normal. it seems that this error doesn't matter?

zigfried-bit commented 1 year ago

I just change stable-diffusion-webui/venv/lib/python3.10/site-packages/httpx/_urlparse.py line 339: port_as_int = int(port) to port_as_int = int("1")

it works,but I don't why.

HorseLuke commented 1 year ago

I added a debug print in stable-diffusion-webui\venv\Lib\site-packages\httpx\_urls.py:

        if isinstance(url, str):
            print(url)
            self._uri_reference = urlparse(url, **kwargs)

It prints such data:

http://127.0.0.1:24554
http://127.0.0.1:24554
http://
https://
all://*localhost
all://*127.0.0.1
all://*::1

Seems that it parsed all proxy-related environment variables. My no_proxy variable is set no_proxy=localhost, 127.0.0.1, ::1, maybe it is the problem.

After changed it to set no_proxy=localhost, 127.0.0.1 (remove all ipv6 related ip), problem solved.

Something went wrong with ipv6 parse?

zigfried-bit commented 1 year ago

I added a debug print in stable-diffusion-webui\venv\Lib\site-packages\httpx\_urls.py:

        if isinstance(url, str):
            print(url)
            self._uri_reference = urlparse(url, **kwargs)

It prints such data:

http://127.0.0.1:24554
http://127.0.0.1:24554
http://
https://
all://*localhost
all://*127.0.0.1
all://*::1

Seems that it parsed all proxy-related environment variables. My no_proxy variable is set no_proxy=localhost, 127.0.0.1, ::1, maybe it is the problem.

After changed it to set no_proxy=localhost, 127.0.0.1 (remove all ipv6 related ip), problem solved.

Something went wrong with ipv6 parse?

Thanks! It works for me!

Orion-zhen commented 1 year ago

I added a debug print in stable-diffusion-webui\venv\Lib\site-packages\httpx\_urls.py:

        if isinstance(url, str):
            print(url)
            self._uri_reference = urlparse(url, **kwargs)

It prints such data:

http://127.0.0.1:24554
http://127.0.0.1:24554
http://
https://
all://*localhost
all://*127.0.0.1
all://*::1

Seems that it parsed all proxy-related environment variables. My no_proxy variable is set no_proxy=localhost, 127.0.0.1, ::1, maybe it is the problem.

After changed it to set no_proxy=localhost, 127.0.0.1 (remove all ipv6 related ip), problem solved.

Something went wrong with ipv6 parse?

I couldn't change no_proxy in ubuntu. So I just add if url == "all://*::1": url = "all://*:1",and it worked for me. Thanks for your idea!