diff --git a/glob/manager_downloader.py b/glob/manager_downloader.py index 8a8c73c0..f26c8a25 100644 --- a/glob/manager_downloader.py +++ b/glob/manager_downloader.py @@ -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)