From 5786ab6be7097efe3ecc98a32981f6b183e45124 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sat, 14 Feb 2026 23:48:43 +0100 Subject: [PATCH] Auto-initialize STAR submodule if missing on first load Detects when the STAR submodule directory is empty (cloned without --recursive) and runs git submodule update --init automatically. Co-Authored-By: Claude Opus 4.6 --- nodes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nodes.py b/nodes.py index 5140a94..8710992 100644 --- a/nodes.py +++ b/nodes.py @@ -14,6 +14,16 @@ folder_paths.folder_names_and_paths["star"] = ( # Put the cloned STAR repo on sys.path so its internal imports work. STAR_REPO = os.path.join(os.path.dirname(os.path.realpath(__file__)), "STAR") + +# Auto-initialize the git submodule if it's empty (e.g. cloned without --recursive). +if not os.path.isdir(os.path.join(STAR_REPO, "video_to_video")): + import subprocess + print("[STAR] Submodule not found — running git submodule update --init ...") + subprocess.check_call( + ["git", "submodule", "update", "--init", "--recursive"], + cwd=os.path.dirname(os.path.realpath(__file__)), + ) + if STAR_REPO not in sys.path: sys.path.insert(0, STAR_REPO)