From 67166799405c8f03f17707c74cda7a79c16c9de5 Mon Sep 17 00:00:00 2001 From: Martial Michel <7586284+mmartial@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:04:32 -0500 Subject: [PATCH] Added comfy_base_path and multiple subpaths that are not affected by base_directory --- folder_paths.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/folder_paths.py b/folder_paths.py index 72c70f594..d039d5798 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -14,10 +14,11 @@ supported_pt_extensions: set[str] = {'.ckpt', '.pt', '.pt2', '.bin', '.pth', '.s folder_names_and_paths: dict[str, tuple[list[str], set[str]]] = {} # --base-directory - Resets all default paths configured in folder_paths with a new base path +comfy_base_path = os.path.dirname(os.path.realpath(__file__)) if args.base_directory: base_path = os.path.abspath(args.base_directory) else: - base_path = os.path.dirname(os.path.realpath(__file__)) + base_path = comfy_base_path models_dir = os.path.join(base_path, "models") folder_names_and_paths["checkpoints"] = ([os.path.join(models_dir, "checkpoints")], supported_pt_extensions) @@ -51,6 +52,14 @@ temp_directory = os.path.join(base_path, "temp") input_directory = os.path.join(base_path, "input") user_directory = os.path.join(base_path, "user") +app_directory = os.path.join(comfy_base_path, "app") +comfy_directory = os.path.join(comfy_base_path, "comfy") +comfy_execution_directory = os.path.join(comfy_base_path, "comfy_execution") +comfy_extras_directory = os.path.join(comfy_base_path, "comfy_extras") +notebooks_directory = os.path.join(comfy_base_path, "notebooks") +utils_directory = os.path.join(comfy_base_path, "utils") +web_directory = os.path.join(comfy_base_path, "web") + filename_list_cache: dict[str, tuple[list[str], dict[str, float], float]] = {} class CacheHelper: