mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-09 14:14:54 +08:00
both aria2 and torchvision.datasets.utils.download_url use HF_ENDPOINT (#1355)
both aria2 and torchvision.datasets.utils.download_url use HF_ENDPOINT to speed up
This commit is contained in:
parent
a41d8d6101
commit
c7511c7aa9
@ -15,6 +15,8 @@ if aria2 is not None:
|
||||
|
||||
|
||||
def download_url(model_url: str, model_dir: str, filename: str):
|
||||
if HF_ENDPOINT:
|
||||
model_url = model_url.replace('https://huggingface.co', HF_ENDPOINT)
|
||||
if aria2:
|
||||
return aria2_download_url(model_url, model_dir, filename)
|
||||
else:
|
||||
@ -44,9 +46,6 @@ def aria2_download_url(model_url: str, model_dir: str, filename: str):
|
||||
if model_dir.startswith(core.comfy_path):
|
||||
model_dir = model_dir[len(core.comfy_path) :]
|
||||
|
||||
if HF_ENDPOINT:
|
||||
model_url = model_url.replace('https://huggingface.co', HF_ENDPOINT)
|
||||
|
||||
download_dir = model_dir if model_dir.startswith('/') else os.path.join('/models', model_dir)
|
||||
|
||||
download = aria2_find_task(download_dir, filename)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user