From c6f4301e8843d1d1be64765555243c5fc2a13c35 Mon Sep 17 00:00:00 2001 From: doctorpangloss <@hiddenswitch.com> Date: Thu, 28 Mar 2024 15:45:04 -0700 Subject: [PATCH] Fix model downloader invoking symlink when it should not --- comfy/model_downloader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy/model_downloader.py b/comfy/model_downloader.py index 8c9971076..fb77430a4 100644 --- a/comfy/model_downloader.py +++ b/comfy/model_downloader.py @@ -51,7 +51,8 @@ def get_or_download(folder_name: str, filename: str, known_files: List[HuggingFi else: linked_filename = None try: - os.symlink(os.path.join(destination, known_file.filename), linked_filename) + if linked_filename is not None: + os.symlink(os.path.join(destination, known_file.filename), linked_filename) except Exception as exc_info: logging.error(f"Failed to link file with alternative download save name in a way that is compatible with Hugging Face caching {repr(known_file)}", exc_info=exc_info) else: