mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2026-03-16 14:17:11 +08:00
Merge 2bcae64cd4cbace1cec69ff522e41a9022102360 into f4fdd51ce98aaa77bccbf1b04c23c6aab925f29b
This commit is contained in:
commit
160da71426
@ -80,10 +80,8 @@ def aria2_download_url(model_url: str, model_dir: str, filename: str):
|
|||||||
import tqdm
|
import tqdm
|
||||||
import time
|
import time
|
||||||
|
|
||||||
if model_dir.startswith(core.comfy_path):
|
download_dir = model_dir
|
||||||
model_dir = model_dir[len(core.comfy_path) :]
|
filename += '.downloading' # aria2 uses .downloading suffix for incomplete files
|
||||||
|
|
||||||
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)
|
||||||
if download is None:
|
if download is None:
|
||||||
@ -104,6 +102,17 @@ def aria2_download_url(model_url: str, model_dir: str, filename: str):
|
|||||||
progress_bar.update(download.completed_length - progress_bar.n)
|
progress_bar.update(download.completed_length - progress_bar.n)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
download.update()
|
download.update()
|
||||||
|
|
||||||
|
if download.is_complete and download.completed_length == download.total_length:
|
||||||
|
file_path = os.path.join(download_dir, filename)
|
||||||
|
final_path = file_path[:-len('.downloading')] # remove the .downloading suffix
|
||||||
|
if os.path.exists(file_path):
|
||||||
|
os.rename(file_path, final_path)
|
||||||
|
logging.info(f"Download completed: {final_path}")
|
||||||
|
else:
|
||||||
|
logging.error(f"Download directory {file_path} does not exist after download completion.")
|
||||||
|
else:
|
||||||
|
logging.error(f"Download failed or incomplete: {download.status} for {model_url}")
|
||||||
|
|
||||||
|
|
||||||
def download_url_with_agent(url, save_path):
|
def download_url_with_agent(url, save_path):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user