Allow override of models base path via env var

This commit is contained in:
filtered 2025-01-23 18:09:15 +11:00
parent f3566f0894
commit 17b70728ec

View File

@ -11,7 +11,8 @@ supported_pt_extensions: set[str] = {'.ckpt', '.pt', '.bin', '.pth', '.safetenso
folder_names_and_paths: dict[str, tuple[list[str], set[str]]] = {}
base_path = os.path.dirname(os.path.realpath(__file__))
env_base_path = os.environ.get("COMFYUI_FOLDERS_BASE_PATH")
base_path = os.path.dirname(os.path.realpath(__file__)) if env_base_path is None else env_base_path
models_dir = os.path.join(base_path, "models")
folder_names_and_paths["checkpoints"] = ([os.path.join(models_dir, "checkpoints")], supported_pt_extensions)
folder_names_and_paths["configs"] = ([os.path.join(models_dir, "configs")], [".yaml"])