From 8317a0603ecdcb1436e67a1f7eed03e36683ec0b Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Fri, 13 Feb 2026 15:42:10 +0100 Subject: [PATCH] Reuse FlashVSR models from 1038lab node if already downloaded Check models/FlashVSR/ (1038lab convention) before models/flashvsr/ to avoid downloading ~7GB of checkpoints twice. Only create the directory when actually downloading. Co-Authored-By: Claude Opus 4.6 --- nodes.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nodes.py b/nodes.py index 71fe9e1..2238b3d 100644 --- a/nodes.py +++ b/nodes.py @@ -1522,9 +1522,18 @@ FLASHVSR_REQUIRED_FILES = [ "Prompt.safetensors", ] -FLASHVSR_MODEL_DIR = os.path.join(folder_paths.models_dir, "flashvsr") -if not os.path.exists(FLASHVSR_MODEL_DIR): - os.makedirs(FLASHVSR_MODEL_DIR, exist_ok=True) +# Check common locations so we reuse models from 1038lab/ComfyUI-FlashVSR +FLASHVSR_MODEL_DIR = None +for _dirname in ("FlashVSR", "flashvsr"): + _candidate = os.path.join(folder_paths.models_dir, _dirname) + if os.path.isdir(_candidate) and all( + os.path.exists(os.path.join(_candidate, f)) for f in FLASHVSR_REQUIRED_FILES + ): + FLASHVSR_MODEL_DIR = _candidate + break +if FLASHVSR_MODEL_DIR is None: + # Default to "FlashVSR" (matches 1038lab convention) + FLASHVSR_MODEL_DIR = os.path.join(folder_paths.models_dir, "FlashVSR") def download_flashvsr_models(model_dir): @@ -1536,6 +1545,7 @@ def download_flashvsr_models(model_dir): if not missing: return + os.makedirs(model_dir, exist_ok=True) logger.info(f"[FlashVSR] Missing files: {', '.join(missing)}. Downloading from HuggingFace...") snapshot_download( repo_id=FLASHVSR_HF_REPO,