lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.17k stars 804 forks source link

just install a fresh forge.... #878

Open wzwow opened 3 months ago

wzwow commented 3 months ago

just install a fresh forge....

what are all this error? how do i resolve this?

UNet ADM Dimension 2816 2024-07-28 15:30:04,425 - ControlNet - INFO - ControlNet UI callback registered. Using pytorch attention in VAE Working with z of shape (1, 4, 32, 32) = 4096 dimensions. Using pytorch attention in VAE Running on local URL: http://127.0.0.1:7860 Exception in thread Thread-26 (webui_worker): Traceback (most recent call last): File "D:\AI\Forge\system\python\lib\site-packages\httpcore_exceptions.py", line 8, in map_exceptions yield File "D:\AI\Forge\system\python\lib\site-packages\httpcore\backends\sync.py", line 26, in read return self._sock.recv(max_bytes) TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\AI\Forge\system\python\lib\site-packages\httpx_transports\default.py", line 60, in map_httpcore_exceptions yield File "D:\AI\Forge\system\python\lib\site-packages\httpx_transports\default.py", line 218, in handle_request resp = self._pool.handle_request(req) File "D:\AI\Forge\system\python\lib\site-packages\httpcore_sync\connection_pool.py", line 253, in handle_request raise exc File "D:\AI\Forge\system\python\lib\site-packages\httpcore_sync\connection_pool.py", line 237, in handle_request response = connection.handle_request(request) File "D:\AI\Forge\system\python\lib\site-packages\httpcore_sync\connection.py", line 90, in handle_request return self._connection.handle_request(request) File "D:\AI\Forge\system\python\lib\site-packages\httpcore_sync\http11.py", line 105, in handle_request raise exc File "D:\AI\Forge\system\python\lib\site-packages\httpcore_sync\http11.py", line 84, in handle_request ) = self._receive_response_headers(**kwargs) File "D:\AI\Forge\system\python\lib\site-packages\httpcore_sync\http11.py", line 148, in _receive_response_headers event = self._receive_event(timeout=timeout) File "D:\AI\Forge\system\python\lib\site-packages\httpcore_sync\http11.py", line 177, in _receive_event data = self._network_stream.read( File "D:\AI\Forge\system\python\lib\site-packages\httpcore\backends\sync.py", line 24, in read with map_exceptions(exc_map): File "contextlib.py", line 153, in exit File "D:\AI\Forge\system\python\lib\site-packages\httpcore_exceptions.py", line 12, in map_exceptions raise to_exc(exc) httpcore.ReadTimeout: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "D:\AI\Forge\webui\webui.py", line 86, in webui_worker app, local_url, share_url = shared.demo.launch( File "D:\AI\Forge\system\python\lib\site-packages\gradio\blocks.py", line 2443, in launch and not networking.url_ok(self.local_url) File "D:\AI\Forge\system\python\lib\site-packages\gradio\networking.py", line 54, in url_ok r = httpx.head(url, timeout=3, verify=False) File "D:\AI\Forge\system\python\lib\site-packages\httpx_api.py", line 265, in head return request( File "D:\AI\Forge\system\python\lib\site-packages\httpx_api.py", line 100, in request return client.request( File "D:\AI\Forge\system\python\lib\site-packages\httpx_client.py", line 814, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) File "D:\AI\Forge\system\python\lib\site-packages\httpx_client.py", line 901, in send response = self._send_handling_auth( File "D:\AI\Forge\system\python\lib\site-packages\httpx_client.py", line 929, in _send_handling_auth response = self._send_handling_redirects( File "D:\AI\Forge\system\python\lib\site-packages\httpx_client.py", line 966, in _send_handling_redirects response = self._send_single_request(request) File "D:\AI\Forge\system\python\lib\site-packages\httpx_client.py", line 1002, in _send_single_request response = transport.handle_request(request) File "D:\AI\Forge\system\python\lib\site-packages\httpx_transports\default.py", line 217, in handle_request with map_httpcore_exceptions(): File "contextlib.py", line 153, in exit File "D:\AI\Forge\system\python\lib\site-packages\httpx_transports\default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ReadTimeout: timed out extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'} To load target model SDXLClipModel Begin to load 1 model [Memory Management] Current Free GPU Memory (MB) = 7139.996185302734 [Memory Management] Model Memory (MB) = 2144.3546981811523 [Memory Management] Minimal Inference Memory (MB) = 1024.0 [Memory Management] Estimated Remaining GPU Memory (MB) = 3971.641487121582 Moving model(s) has taken 0.55 seconds Model loaded in 13.2s (load weights from disk: 0.3s, forge instantiate config: 2.1s, forge load real models: 9.9s, calculate empty prompt: 0.8s).

jasoncow007 commented 3 months ago

same issue, anyone know how to fix this?

JoRoFox commented 3 months ago

i have a similar error with a httpx.ReadTimeout after updating Forge UI, it also does not open the UI automatically in browser anymore, and when i want to access my generation info in Image browser i only get a AttributeError. these errors made my Forge UI unusable. i would try to reinstall but i really dont want to set up everything again like my model folders, wildcards and quick settings. Is there maybe a way to reload the dependencies like deleting the venv dir in Automatic1111? this had helped me once in Automatic1111 but there is no venv dir in Forge it seams.

dongxiat commented 3 months ago

yep me too... and i fresh install too then it work well... this is my solution :

  1. download : https://github.com/lllyasviel/stable-diffusion-webui-forge/releases/download/previous/webui_forge_cu121_torch21_f0017.7z
  2. unpack and run update.bat to latest version with gradio version 4
  3. then edit file webui-user.bat to use old models, lora, embeddings.... u can see tutorial : here
  4. copy latest backup config file in webui_forge_cu121_torch21\webui\config_states to webui_forge_cu121_torch21_f0017\webui\config_states
  5. go run.bat >> install extension same old version then >> extension >> backup/restore >> choose backup file (both) >> restore
mel870 commented 3 months ago

Same error on Runpod. Old Forge version works. New version will only launch the first time on a fresh server without the httpx errors. After the first launch, it will throw the timeoutError if I need to restart even after a server restart. I decided to try a docker image, which is the latest version of Forge, and that works. I then gave it another try without docker using newer pytorch version, still got the time out errors. However this time, the webui works and generates images despite the error.

mart-hill commented 2 months ago

Indeed, this happens to me, on CUDA-malloc backend, too. First run was fine, then I added --pin-shared-memory --cuda-malloc --cuda-stream params to webui-user.bat file. I'll test out again, without these parameters, as it was at the beginning. EDIT: The bug persists.

It seems this bug prevents users from seeing, what the UI actually does at the moment, including live previews. The Generate button also changes back quickly to default state, and the generation progress isn't visible in the UI, but it's present in the terminal window. The auto-opening of the localhost:7xxx UI page also stopped working because of that.

The bug has probably something to do with websockets timing out, so I'll try running the UI without them, if it's possible.

mel870 commented 2 months ago

For now my work around for runpod is to use the docker image. I also did a git pull for Forge to update as I see there are some changes made within the last 8 hours (same error). I download all extensions I need to use manually. Then, edit webui-user.sh arguments and change the port so I can run another instance since the docker auto launches. Then start a second instance on the new port. This time, there were no timeout errors, and the UI progress timers are visible. So changing the port could be what resolved the timeout.

With the docker image, I still get the errors after restarting Forge within extension settings.

Note: I also changed the timeout in the httpx config file from 5 seconds to 30 seconds, which was a suggestion in the gradio git for timeout errors and that did not help.

I'm going to test a manual install later to see if changing the port on a relaunch resolves any errors. But that's not a solution if you need to simply restart Forge without constantly changing port numbers each restart.

mart-hill commented 2 months ago

Ah, yes, my first Forge run did use different port, since I was also running stable-diffusion-webui-ux at the same time on port 7860. Forge selected 7862, if I recall correctly. :)

mel870 commented 2 months ago

Since runpod is using a proxy, I'm guessing that causes the error. But it's odd a server restart which would free up the same port does not resolve the error. It's must be a gradio issue since the old Forge works fine. I use a Silicon Mac which is overall useless for most image generations with SDXL, but I will test a Forge install locally to see if there are time out errors.

mart-hill commented 2 months ago

I've tried to use --no-gradio-queue parameter to disable websockets, but to no avail, there's still timeout. Now, I'll test the UI on port 7865.

Drat. Still times out. :)

mel870 commented 2 months ago

Hopefully there will be a fix soon. I'm guessing this only affects users who are not running locally or behind a proxy.

mart-hill commented 2 months ago

I'm totally running the UI locally on Windows, no proxies (unless I count AdGuard to be one, I use its networking driver however) :) I'm trying to find, where's the ConnectTimeout defined as a number. :)

mel870 commented 2 months ago

If you're not using a proxy, possibly the solution to change the httpx config.py timeout will work. It did not work for a Runpod setup.

https://github.com/gradio-app/gradio/issues/5143

mart-hill commented 2 months ago

Thank you! I'll try that! Did DEFAULT_TIMEOUT_CONFIG = Timeout(timeout=35.0) - didn't help, so I changed line 54 in gradio\networking.py to: r = httpx.head(url, timeout=30, verify=False) and it seems it works. It was '3' before, so I'd say it could be a bug, someone forgot to put '0' after '3'. :P EDIT: Yup, everything works afterwards, live previews, everything.

mel870 commented 2 months ago

r = httpx.head(url, timeout=30, verify=False) and it seems it works. It was '3' before, so I'd say it could be a bug, someone forgot to put '0' after '3'. :P EDIT: Yup, everything works afterwards, live previews, everything.

Good catch, I will test that as well.

Kuroseji commented 2 months ago

Thank you! I'll try that! Did DEFAULT_TIMEOUT_CONFIG = Timeout(timeout=35.0) - didn't help, so I changed line 54 in gradio\networking.py to: r = httpx.head(url, timeout=30, verify=False) and it seems it works. It was '3' before, so I'd say it could be a bug, someone forgot to put '0' after '3'. :P EDIT: Yup, everything works afterwards, live previews, everything.

Worked for me. Thanks a lot.

mart-hill commented 2 months ago

Gradio 4.40 still has this bug in networking.py, so manual fix fox now... :)