From 17ece725cfa45e4b9f5b532cffe45e7129986194 Mon Sep 17 00:00:00 2001 From: Habib Date: Fri, 5 Dec 2025 15:55:57 +0100 Subject: [PATCH] DownloadFile: accept cached local files from wrapper --- download_nodes/downloader.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/download_nodes/downloader.py b/download_nodes/downloader.py index 07d3a9d..7c21efe 100644 --- a/download_nodes/downloader.py +++ b/download_nodes/downloader.py @@ -60,11 +60,16 @@ def _validate_url(url: str) -> str: if _is_blocked_ip(parsed.hostname): raise ValueError("Refusing to access private or invalid host") return url - # Accept file:// or plain local paths + # Accept file:// or local paths (absolute or relative to ComfyUI input dir) if parsed.scheme == "file": path = parsed.path - elif parsed.scheme == "" and parsed.netloc == "" and os.path.exists(url): - path = url + elif parsed.scheme == "" and parsed.netloc == "": + # First try as-is, then relative to input directory + if os.path.exists(url): + path = url + else: + candidate = os.path.join(folder_paths.get_input_directory(), url) + path = candidate if os.path.exists(candidate) else url else: raise ValueError("URL must be http/https with a host or an existing local path") if not os.path.exists(path):