当前位置:AIGC资讯 > AIGC > 正文

stable-diffusion使用openpose报错

依据教程 : https://post.smzdm.com/p/awz2l2xg/

使用 stable-diffusion教学之ControlNet+lora换脸

报错:

urllib.error.URLError: <urlopen error [WinError 10054] 远程主机强迫关闭了一个现有的连接。>

  File "E:\ai\sd-webui-aki-v4\extensions\sd-webui-controlnet\scripts\utils.py", line 64, in cached_func
    return func(*args, **kwargs)
  File "E:\ai\sd-webui-aki-v4\extensions\sd-webui-controlnet\scripts\global_state.py", line 35, in unified_preprocessor
    return preprocessor_modules[preprocessor_name](*args, **kwargs)
  File "E:\ai\sd-webui-aki-v4\extensions\sd-webui-controlnet\scripts\processor.py", line 251, in run_model
    return remove_pad(self.model_openpose(
  File "E:\ai\sd-webui-aki-v4\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 324, in __call__
    poses = self.detect_poses(oriImg, include_hand, include_face)
  File "E:\ai\sd-webui-aki-v4\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 268, in detect_poses
    self.load_model()
  File "E:\ai\sd-webui-aki-v4\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 192, in load_model
    load_file_from_url(body_model_path, model_dir=self.model_dir)
  File "E:\ai\sd-webui-aki-v4\py310\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 "E:\ai\sd-webui-aki-v4\py310\lib\site-packages\torch\hub.py", line 611, in download_url_to_file
    u = urlopen(req)
  File "urllib\request.py", line 216, in urlopen
  File "urllib\request.py", line 519, in open
  File "urllib\request.py", line 536, in _open
  File "urllib\request.py", line 496, in _call_chain
  File "urllib\request.py", line 1391, in https_open
  File "urllib\request.py", line 1351, in do_open
urllib.error.URLError: <urlopen error [WinError 10054] 远程主机强迫关闭了一个现有的连接。>

翻上去一点点看:

2023-07-02 16:09:42,639 - ControlNet - INFO - Preview Resolution = 512
Downloading: "https://huggingface.co/lllyasviel/Annotators/resolve/main/body_pose_model.pth" to E:\ai\sd-webui-aki-v4\extensions\sd-webui-controlnet\annotator\downloads\openpose\body_pose_model.pth

Traceback (most recent call last):
  File "urllib\request.py", line 1348, in do_open
  File "http\client.py", line 1283, in request
  File "http\client.py", line 1329, in _send_request
  File "http\client.py", line 1278, in endheaders
  File "http\client.py", line 1038, in _send_output
  File "http\client.py", line 976, in send
  File "http\client.py", line 1455, in connect
  File "ssl.py", line 513, in wrap_socket
  File "ssl.py", line 1071, in _create
  File "ssl.py", line 1342, in do_handshake
ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

这时候我们已经找到了关键点了:

Downloading 的时候 ConnectionResetError: [WinError 10054]

所以将相关的文件下载到对应的路径就OK了
如图:

成功如图:

附下载地址:
建议直接搜这四个文件就好:
facenet.pth
body_pose_model.pth
control_sd15_openpose.pth
hand_pose_model.pth

https://cdn-lfs.huggingface.co/repos/f6/65/f665e553e8fd16131981a96c629e785939f08080bb3cbf8d2b7f5ddbd9e6100a/d19ffffeeaff6d9feb2204b234c3e1b9aec039ab3e63fca07f4fe5646f2ef591?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27control_sd15_openpose.pth%3B+filename%3D%22control_sd15_openpose.pth%22%3B&Expires=1688535600&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2Y2LzY1L2Y2NjVlNTUzZThmZDE2MTMxOTgxYTk2YzYyOWU3ODU5MzlmMDgwODBiYjNjYmY4ZDJiN2Y1ZGRiZDllNjEwMGEvZDE5ZmZmZmVlYWZmNmQ5ZmViMjIwNGIyMzRjM2UxYjlhZWMwMzlhYjNlNjNmY2EwN2Y0ZmU1NjQ2ZjJlZjU5MT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2ODg1MzU2MDB9fX1dfQ__&Signature=K%7Ev5YI1pBSp-7XdAtDscEUM3hzaAtZfPebpwBuxvp4PKocU5Fs8msZHpTS3Xuh-djTduk7QYI9wxwTqZE%7EC-gFb-GkWBUMEV4D6rijlRfN45nXJer-PSuj49DCatKcGwkJe1m-Box8W0otzOdavGBU2OUniTFcy7YaIqI6cedUt9UYHUEIblzQH25QwKvB1pziw5FeJpX7wEIPR67XOfwoUIN7dDJrnyRYqIjH9yboNqEZ1tqf7jlLO8JaNmqJVag0tQNJYlruUqVQP5cKPX9NcqusRWzVEgSD9zBvLCiAMtUp9UZ3lTGtG%7ENbxQSIT2PEG5Si4SZHFAoXc08ZO2vw__&Key-Pair-Id=KVTP0A1DKRTAX
https://cdn-lfs.huggingface.co/repos/f6/65/f665e553e8fd16131981a96c629e785939f08080bb3cbf8d2b7f5ddbd9e6100a/b76b00d1750901abd07b9f9d8c98cc3385b8fe834a26d4b4f0aad439e75fc600?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27hand_pose_model.pth%3B+filename%3D%22hand_pose_model.pth%22%3B&Expires=1688534365&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2Y2LzY1L2Y2NjVlNTUzZThmZDE2MTMxOTgxYTk2YzYyOWU3ODU5MzlmMDgwODBiYjNjYmY4ZDJiN2Y1ZGRiZDllNjEwMGEvYjc2YjAwZDE3NTA5MDFhYmQwN2I5ZjlkOGM5OGNjMzM4NWI4ZmU4MzRhMjZkNGI0ZjBhYWQ0MzllNzVmYzYwMD9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2ODg1MzQzNjV9fX1dfQ__&Signature=y7an-g4hwfkuL%7E%7EvmpB40N3jHunk2MuQTYaolxr3LhIsG2HsdYVYoIe4RhbpFYYHYjI-eX58W130ZmqvTvzyT5%7EACk6aW%7ELZ5QtIiXZFn%7EV0wQN4DkthM78fzbHMzc9lPwJuknyXpIYw0FdUBcjFussMGI1AfaBBhkmAkzWBWaF9D%7E2nZsJAZ9kgzozXMF7gRqBwffCJrQgqEDmeVEeNhQRCSpl-cTqoHKYzIZRWZUupnuXc18yCzhxZ1HIOSp0AxNI9SZDzQNEFGZVP2WCcj1CoBUS687Dm3wXQ4gTNTAhDVP%7EQjjM8Azt7lA%7EPmlH0lQwsovoORzE%7E0QRpsiP%7EtA__&Key-Pair-Id=KVTP0A1DKRTAX
https://cdn-lfs.huggingface.co/repos/a2/11/a211ef997fa284ad67caa591ca931692f9a8a018910b18a04d9e6dff396f02e3/8beb52e548624ffcc4aed12af7aee7dcbfaeea420c75609fee999fe7add79d43?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27facenet.pth%3B+filename%3D%22facenet.pth%22%3B&Expires=1688532507&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2EyLzExL2EyMTFlZjk5N2ZhMjg0YWQ2N2NhYTU5MWNhOTMxNjkyZjlhOGEwMTg5MTBiMThhMDRkOWU2ZGZmMzk2ZjAyZTMvOGJlYjUyZTU0ODYyNGZmY2M0YWVkMTJhZjdhZWU3ZGNiZmFlZWE0MjBjNzU2MDlmZWU5OTlmZTdhZGQ3OWQ0Mz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2ODg1MzI1MDd9fX1dfQ__&Signature=sURfU0p2mMJmvhrQNq5GY9-H5p2v6KyFiHwJXnTYLI24XF3qjdFG9GCuhB0LmHCLX8j9Fm4bbr7MqZuG3e2vR9XB07jW7bWQ72EZsgrs1bXSRmlaqbpCsauQRqUMQOoyOQjHoipOvrcXWR1AWcXf6jahlpspCvN1T3ApRuRCpl2xXushcclKj2FdAYS3neQb4mcuAJykAGCPGN2PxEOLjTJI03SgLRx%7E0gy8a59RmFPsF8FMsQKnYZaPg2HFW3SCIe7OSrfSp9JGduPK44w4yOGPqoXQ1RKIeUKAYMdsOdIGHcL27HFH9EpIaPI0qU8x9BwBHDNQLaekmuZWMfvVqg__&Key-Pair-Id=KVTP0A1DKRTAX
https://cdn-lfs.huggingface.co/repos/a2/11/a211ef997fa284ad67caa591ca931692f9a8a018910b18a04d9e6dff396f02e3/8beb52e548624ffcc4aed12af7aee7dcbfaeea420c75609fee999fe7add79d43?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27facenet.pth%3B+filename%3D%22facenet.pth%22%3B&Expires=1688532507&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zL2EyLzExL2EyMTFlZjk5N2ZhMjg0YWQ2N2NhYTU5MWNhOTMxNjkyZjlhOGEwMTg5MTBiMThhMDRkOWU2ZGZmMzk2ZjAyZTMvOGJlYjUyZTU0ODYyNGZmY2M0YWVkMTJhZjdhZWU3ZGNiZmFlZWE0MjBjNzU2MDlmZWU5OTlmZTdhZGQ3OWQ0Mz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2ODg1MzI1MDd9fX1dfQ__&Signature=sURfU0p2mMJmvhrQNq5GY9-H5p2v6KyFiHwJXnTYLI24XF3qjdFG9GCuhB0LmHCLX8j9Fm4bbr7MqZuG3e2vR9XB07jW7bWQ72EZsgrs1bXSRmlaqbpCsauQRqUMQOoyOQjHoipOvrcXWR1AWcXf6jahlpspCvN1T3ApRuRCpl2xXushcclKj2FdAYS3neQb4mcuAJykAGCPGN2PxEOLjTJI03SgLRx%7E0gy8a59RmFPsF8FMsQKnYZaPg2HFW3SCIe7OSrfSp9JGduPK44w4yOGPqoXQ1RKIeUKAYMdsOdIGHcL27HFH9EpIaPI0qU8x9BwBHDNQLaekmuZWMfvVqg__&Key-Pair-Id=KVTP0A1DKRTAX**

更新时间 2023-12-06