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

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

Open shawhu opened this issue 1 year ago • 11 comments

Is there an existing issue for this?

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

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 avatar Apr 12 '23 11:04 shawhu

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.

shawhu avatar Apr 12 '23 11:04 shawhu

same error

httpx.InvalidURL: Invalid port

jony4 avatar Apr 12 '23 11:04 jony4

+1

niwaguan avatar Apr 13 '23 03:04 niwaguan

+1

Fezaries avatar Apr 13 '23 05:04 Fezaries

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

Orion-zhen avatar Apr 13 '23 11:04 Orion-zhen

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

shawhu avatar Apr 13 '23 12:04 shawhu

try to pip install httpx==0.23.0

egoeyre avatar Apr 14 '23 10:04 egoeyre

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?

Orion-zhen avatar Apr 15 '23 02:04 Orion-zhen

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.

zigfried-bit avatar Apr 15 '23 03:04 zigfried-bit

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?

HorseLuke avatar Apr 15 '23 04:04 HorseLuke

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!

zigfried-bit avatar Apr 15 '23 05:04 zigfried-bit

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!

Orion-zhen avatar Apr 20 '23 04:04 Orion-zhen