From d3d613cca94ebeb96d61f0c59bff1fc8ec1cb042 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Tue, 25 Feb 2025 12:38:05 +0900 Subject: [PATCH] improved: cm-cli.sh - add `--restore-to` option to `restore-snapshot` command --- cm-cli.py | 12 ++++++++++++ glob/manager_core.py | 2 +- pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cm-cli.py b/cm-cli.py index 2e152791..d591d268 100644 --- a/cm-cli.py +++ b/cm-cli.py @@ -152,6 +152,11 @@ class Ctx: if y != '': cm_global.pip_blacklist.add(y) + def update_custom_nodes_dir(self, target_dir): + import folder_paths + a, b = folder_paths.folder_names_and_paths['custom_nodes'] + folder_paths.folder_names_and_paths['custom_nodes'] = [os.path.abspath(target_dir)], set() + @staticmethod def get_startup_scripts_path(): return os.path.join(core.manager_startup_script_path, "install-scripts.txt") @@ -1075,10 +1080,17 @@ def restore_snapshot( user_directory: str = typer.Option( None, help="user directory" + ), + restore_to: Optional[str] = typer.Option( + None, + help="Manually specify the installation path for the custom node. Ignore user directory." ) ): cmd_ctx.set_user_directory(user_directory) + if restore_to: + cmd_ctx.update_custom_nodes_dir(restore_to) + extras = [] if pip_non_url: extras.append('--pip-non-url') diff --git a/glob/manager_core.py b/glob/manager_core.py index 2c5907f1..ba6840de 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -42,7 +42,7 @@ import manager_downloader from node_package import InstalledNodePackage -version_code = [3, 26, 1] +version_code = [3, 26, 2] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') diff --git a/pyproject.toml b/pyproject.toml index b5ff3db5..d370b3cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-manager" description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." -version = "3.26.1" +version = "3.26.2" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions", "toml", "uv", "chardet"]