mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 10:22:59 +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):
|
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:
|
if aria2:
|
||||||
return aria2_download_url(model_url, model_dir, filename)
|
return aria2_download_url(model_url, model_dir, filename)
|
||||||
else:
|
else:
|
||||||
@ -44,9 +46,6 @@ def aria2_download_url(model_url: str, model_dir: str, filename: str):
|
|||||||
if model_dir.startswith(core.comfy_path):
|
if model_dir.startswith(core.comfy_path):
|
||||||
model_dir = model_dir[len(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_dir = model_dir if model_dir.startswith('/') else os.path.join('/models', model_dir)
|
||||||
|
|
||||||
download = aria2_find_task(download_dir, filename)
|
download = aria2_find_task(download_dir, filename)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user