add:if the huggingface connection timeout, it will switch to the mirrored address to download

This commit is contained in:
yolain
2024-04-03 19:36:08 +08:00
parent 39c5ccf469
commit 149fab2105
4 changed files with 18 additions and 8 deletions
+1 -3
View File
@@ -31,7 +31,7 @@
## Changelog
**v1.1.2 (2024/3/25)**
**v1.1.2 (39c5ccf)**
- Optimized some of the recommended nodes for slots related to EasyUse
- Added **Enable ContextMenu Auto Nest Subdirectories** The setting item is enabled by default, and it can be classified into subdirectories, checkpoints and loras previews
@@ -44,8 +44,6 @@
- Added `easy preMaskDetailerFix`
- Fixed `easy stylesSelector` is change the prompt when not select the style
(4c25580)
- `easy kSamplerInpainting` add *additional* widget,you can choose 'Differential Diffusion' or 'Only InpaintModelConditioning'
- Fixed `easy pipeEdit` error when add lora to prompt
- Fixed layerDiffuse xyplot bug
+5 -3
View File
@@ -35,7 +35,11 @@
## 更新日志
**v1.1.2 (2024/3/25)**
**v1.1.3 (2024/4/3)**
- 增加 当节点需要下载模型时,若huggingface连接超时,会切换至镜像地址下载模型
**v1.1.2 (39c5ccf)**
- 改写 EasyUse 相关节点的部分插槽推荐节点
- 增加 **启用上下文菜单自动嵌套子目录** 设置项,默认为启用状态,可分类子目录及checkpoints、loras预览图
@@ -48,8 +52,6 @@
- 增加 `easy preMaskDetailerFix`
- 修复 `easy stylesSelector` 当未选择样式时,原有提示词发生了变化
(4c25580)
- `easy kSamplerInpainting` 增加 *additional* 属性,可设置成 Differential Diffusion 或 Only InpaintModelConditioning
- 修复 `easy pipeEdit` 提示词输入lora时报错
- 修复 layerDiffuse xyplot相关bug
+1 -1
View File
@@ -85,4 +85,4 @@ WEB_DIRECTORY = "./web"
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', "WEB_DIRECTORY"]
print('\033[34mComfy-Easy-Use (v1.1.2): \033[92mLoaded\033[0m')
print('\033[34mComfy-Easy-Use (v1.1.3): \033[92mLoaded\033[0m')
+11 -1
View File
@@ -134,7 +134,17 @@ def get_local_filepath(url, dirname, local_file_name=None):
destination = os.path.join(dirname, local_file_name)
if not os.path.exists(destination):
print(f'downloading {url} to {destination}')
download_url_to_file(url, destination)
try:
download_url_to_file(url, destination)
except Exception as e:
args = e.args[0] if e.args is not None and len(e.args) > 0 else None
if isinstance(args, TimeoutError):
print(f'无法从 {url} 下载,正在尝试使用镜像地址...')
url = url.replace('huggingface.co', 'hf-mirror.com')
try:
download_url_to_file(url, destination)
except Exception as err:
raise Exception(f'无法从 {url} 下载,错误信息:{str(err.args[0])}')
return destination
def to_lora_patch_dict(state_dict: dict) -> dict: