From ccd0b4dc1da02ab192de3a6ccbe12d7c9ebdde3c Mon Sep 17 00:00:00 2001 From: Sonny Box Date: Wed, 18 Mar 2026 19:35:31 -0700 Subject: [PATCH] fix: duplicate alias name preventing normal model to run --- tools/model_downloader.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/model_downloader.py b/tools/model_downloader.py index 9041ec2..7c45fd0 100644 --- a/tools/model_downloader.py +++ b/tools/model_downloader.py @@ -151,16 +151,21 @@ class SuperModelDownloader(io.ComfyNode): dest_path = os.path.join(dest_dir, filename) is_alias = bool(alias.strip()) + total_size = int(response.headers.get("content-length", 0)) + response_etag = response.headers.get("etag") + response_last_modified = response.headers.get("last-modified") + if is_alias and os.path.exists(dest_path): + existing_final_size = os.path.getsize(dest_path) + if total_size > 0 and existing_final_size == total_size: + print(f"✅ File {filename} already exists. Skipping download") + return io.NodeOutput(filename) raise ValueError( f"Alias '{alias.strip()}' is already taken in '{destination}' as '{filename}'. Please choose a different alias or remove the existing file first." ) active_dest_path = f"{dest_path}.part" if is_alias else dest_path - total_size = int(response.headers.get("content-length", 0)) - response_etag = response.headers.get("etag") - response_last_modified = response.headers.get("last-modified") existing_size = ( os.path.getsize(active_dest_path) if os.path.exists(active_dest_path)