【StableDiffusion秋叶包反斜杠问题】Failed to find xxx\sd-webui-aki-v4.8\...\xxx.pth

一、问题发生

1.在我额外安装预处理器时报错

意思是没办法找到有这么一个包(但我已经把这个包扔进去了)

完整报错:

python 复制代码
Failed to find S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\annotator\downloads\hand_refiner\hr16/ControlNet-HandRefiner-pruned\hrnetv2_w64_imagenet_pretrained.pth.
 Downloading from huggingface.co
'HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /hr16/ControlNet-HandRefiner-pruned/resolve/main/hrnetv2_w64_imagenet_pretrained.pth (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001B68B6B5930>, 'Connection to huggingface.co timed out. (connect timeout=100)'))' thrown while requesting HEAD https://huggingface.co/hr16/ControlNet-HandRefiner-pruned/resolve/main/hrnetv2_w64_imagenet_pretrained.pth
WARNING:huggingface_hub.utils._http:'HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /hr16/ControlNet-HandRefiner-pruned/resolve/main/hrnetv2_w64_imagenet_pretrained.pth (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001B68B6B5930>, 'Connection to huggingface.co timed out. (connect timeout=100)'))' thrown while requesting HEAD https://huggingface.co/hr16/ControlNet-HandRefiner-pruned/resolve/main/hrnetv2_w64_imagenet_pretrained.pth
Traceback (most recent call last):
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 939, in run_annotator
    result = preprocessor.cached_call(
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\utils.py", line 81, in decorated_func
    return cached_func(*args, **kwargs)
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\utils.py", line 65, in cached_func
    return func(*args, **kwargs)
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\supported_preprocessor.py", line 172, in cached_call
    return self(*args, **kwargs)
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\legacy_preprocessors.py", line 97, in __call__
    result, is_image = self.call_function(
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\processor.py", line 793, in run_model
    self.load_model()
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\processor.py", line 779, in load_model
    self.model = MeshGraphormerDetector.from_pretrained(
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\hand_refiner\__init__.py", line 15, in from_pretrained
    args.hrnet_checkpoint = custom_hf_download(pretrained_model_or_path, hrnet_filename, cache_dir)
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\hand_refiner\util.py", line 178, in custom_hf_download
    model_path = hf_hub_download(repo_id=pretrained_model_or_path,
  File "<enhanced_experience patches.hfmirror.huggingface_hub>", line 52, in hf_hub_download_wrapper_inner
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\huggingface_hub\utils\_validators.py", line 120, in _inner_fn
    return fn(*args, **kwargs)
  File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\huggingface_hub\file_download.py", line 1291, in hf_hub_download
    raise LocalEntryNotFoundError(
huggingface_hub.utils._errors.LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on.
2.问题原因

看看这里,为什么反斜杠突然变成了 "/" ?

这种路径能找到才怪了

二、解决办法

1.寻找报错位置

抛出异常:

能看到是在这个 hf_hub_download 函数中抛出的异常。

python 复制代码
File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\huggingface_hub\file_download.py", line 1291, in hf_hub_download
    raise LocalEntryNotFoundError(

继续寻找:

可以看到这个函数 _inner_fn,它很有可能是一个 inner_wrapper

python 复制代码
File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\huggingface_hub\utils\_validators.py", line 120, in _inner_fn
    return fn(*args, **kwargs)

继续寻找:

果然,我们看到了一个 增强函数 "hf_hub_download_wrapper_inner"

python 复制代码
File "<enhanced_experience patches.hfmirror.huggingface_hub>", line 52, in hf_hub_download_wrapper_inner

继续寻找:

我们发现了要寻找的包含 "路径"参数 的第一个函数 hf_hub_download

接下来直奔这个文件,寻找此函数,能够清晰看到它使用了 " / " 作为 split 分隔

python 复制代码
File "S:\app_AI\stableDiffusion-webui-aki\sd-webui-aki-v4.8\python\lib\site-packages\hand_refiner\util.py", line 178, in custom_hf_download
  model_path = hf_hub_download(repo_id=pretrained_model_or_path,
2.开始解决

更改 " / " 为 " \\",即可解决问题(转义字符,必须来两个 \ ,不用我说了吧)

如图所示:

相关推荐
想成为高手4993 分钟前
生成式AI在教育技术中的应用:变革与创新
人工智能·aigc
z千鑫14 小时前
【人工智能】PyTorch、TensorFlow 和 Keras 全面解析与对比:深度学习框架的终极指南
人工智能·pytorch·深度学习·aigc·tensorflow·keras·codemoss
程序员X小鹿18 小时前
AI视频自动剪辑神器!点赞上万的影视剧片段,一键全自动剪辑,效率提升80%!(附保姆级教程)
aigc
yuzhangfeng20 小时前
【 模型】 开源图像模型Stable Diffusion入门手册
stable diffusion
学习前端的小z1 天前
【AIGC】如何准确引导ChatGPT,实现精细化GPTs指令生成
人工智能·gpt·chatgpt·aigc
刘悦的技术博客1 天前
MagicQuill,AI动态图像元素修改,AI绘图,需要40G的本地硬盘空间,12G显存可玩,Win11本地部署
ai·aigc·python3.11
xindoo2 天前
如何用GPT-4o解读视频
aigc·gpt-3·音视频
起名字真南2 天前
【C++】深入理解 C++ 中的继承进阶:多继承、菱形继承及其解决方案
java·jvm·c++·chatgpt·aigc
Jartto2 天前
2025年AI革命:斯坦福李飞飞教授揭秘多模态智能体的未来
aigc
浪淘沙jkp2 天前
(一)Ubuntu22.04服务器端部署Stable-Diffusion-webui AI绘画环境
ai作画·stable diffusion