lllyasviel / ControlNet

Let us control diffusion models!
Apache License 2.0
28.97k stars 2.62k forks source link

Preprocessor preview gives out error 'urllib.error.URLError' #624

Closed yukilee219 closed 4 months ago

yukilee219 commented 6 months ago

2024-01-05 (1)

venv "C:\Users\user\Desktop\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Installing sd-webui-controlnet requirement: trimesh[easy]
Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Style database not found: C:\Users\user\Desktop\stable-diffusion-webui\styles.csv
[-] ADetailer initialized. version: 24.1.0, num models: 9
ControlNet preprocessor location: C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2024-01-05 20:47:06,611 - ControlNet - INFO - ControlNet v1.1.427
2024-01-05 20:47:06,661 - ControlNet - INFO - ControlNet v1.1.427
Loading weights [7c819b6d13] from C:\Users\user\Desktop\stable-diffusion-webui\models\Stable-diffusion\majicmixRealistic_v7.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: C:\Users\user\Desktop\stable-diffusion-webui\configs\v1-inference.yaml
Startup time: 9.6s (prepare environment: 3.1s, import torch: 1.8s, import gradio: 0.6s, setup paths: 0.5s, initialize shared: 0.2s, other imports: 0.3s, load scripts: 2.2s, create ui: 0.3s, gradio launch: 0.4s).
Loading VAE weights specified in settings: C:\Users\user\Desktop\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.ckpt
Applying attention optimization: Doggettx... done.
Model loaded in 3.3s (load weights from disk: 0.5s, create model: 0.2s, apply weights to model: 1.1s, load VAE: 0.8s, calculate empty prompt: 0.6s).
2024-01-05 20:47:47,350 - ControlNet - INFO - Preview Resolution = 512
Downloading: "https://huggingface.co/lllyasviel/Annotators/resolve/main/body_pose_model.pth" to C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads\openpose\body_pose_model.pth

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1037, in _send_output
    self.send(msg)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 975, in send
    self.connect()
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1071, in _create
    self.do_handshake()
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 729, in run_annotator
    result, is_image = preprocessor(
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 75, in decorated_func
    return cached_func(*args, **kwargs)
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 63, in cached_func
    return func(*args, **kwargs)
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\global_state.py", line 37, in unified_preprocessor
    return preprocessor_modules[preprocessor_name](*args, **kwargs)
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\processor.py", line 257, in run_model
    return remove_pad(self.model_openpose(
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 447, in __call__
    poses = self.detect_poses(oriImg, include_hand, include_face)
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 333, in detect_poses
    self.load_model()
  File "C:\Users\user\Desktop\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 208, in load_model
    load_file_from_url(body_model_path, model_dir=self.model_dir)
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\basicsr\utils\download_util.py", line 98, in load_file_from_url
    download_url_to_file(url, cached_file, hash_prefix=None, progress=progress)
  File "C:\Users\user\Desktop\stable-diffusion-webui\venv\lib\site-packages\torch\hub.py", line 611, in download_url_to_file
    u = urlopen(req)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 519, in open
    response = self._open(req, data)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

canny works just fine, but other like openpose and depth gives out this error. i have tried 'pip install --upgrade certifi' but it does nothing.

Reeder113 commented 5 months ago

Did you ever find a solution to this? I'm getting the same errors and having the exact same problem. Canny works fine, but openpose, depth, etc. throw out that error.

jlz52z commented 4 months ago

Maybe it's because your network is not stable enough. If you are using a proxy, switch to a more stable one. Or you can download these files manually and put them into the correct location

yukilee219 commented 4 months ago

Maybe it's because your network is not stable enough. If you are using a proxy, switch to a more stable one. Or you can download these files manually and put them into the correct location

Thanks for the advice the control net is working for me now maybe because of updates, thanks