mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-19 19:33:03 +08:00
print raw download url for convenience (#1478)
* print raw download url for convenience * print raw download url for convenience
This commit is contained in:
parent
41998565db
commit
9a5c7c10de
@ -2,7 +2,7 @@ import os
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
import urllib
|
import urllib
|
||||||
import sys
|
import sys
|
||||||
|
import logging
|
||||||
aria2 = os.getenv('COMFYUI_MANAGER_ARIA2_SERVER')
|
aria2 = os.getenv('COMFYUI_MANAGER_ARIA2_SERVER')
|
||||||
HF_ENDPOINT = os.getenv('HF_ENDPOINT')
|
HF_ENDPOINT = os.getenv('HF_ENDPOINT')
|
||||||
|
|
||||||
@ -44,6 +44,7 @@ def basic_download_url(url, dest_folder: str, filename: str):
|
|||||||
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:
|
if HF_ENDPOINT:
|
||||||
model_url = model_url.replace('https://huggingface.co', HF_ENDPOINT)
|
model_url = model_url.replace('https://huggingface.co', HF_ENDPOINT)
|
||||||
|
logging.info(f"model_url replaced by HF_ENDPOINT, new = {model_url}")
|
||||||
if aria2:
|
if aria2:
|
||||||
return aria2_download_url(model_url, model_dir, filename)
|
return aria2_download_url(model_url, model_dir, filename)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -1143,9 +1143,9 @@ async def install_model(request):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if model_path is not None:
|
if model_path is not None:
|
||||||
logging.info(f"Install model '{json_data['name']}' into '{model_path}'")
|
|
||||||
|
|
||||||
model_url = json_data['url']
|
model_url = json_data['url']
|
||||||
|
logging.info(f"Install model '{json_data['name']}' from '{model_url}' into '{model_path}'")
|
||||||
if not core.get_config()['model_download_by_agent'] and (
|
if not core.get_config()['model_download_by_agent'] and (
|
||||||
model_url.startswith('https://github.com') or model_url.startswith('https://huggingface.co') or model_url.startswith('https://heibox.uni-heidelberg.de')):
|
model_url.startswith('https://github.com') or model_url.startswith('https://huggingface.co') or model_url.startswith('https://heibox.uni-heidelberg.de')):
|
||||||
model_dir = get_model_dir(json_data, True)
|
model_dir = get_model_dir(json_data, True)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user