From 05162090b8b29fd8ba144625121f44283baa9001 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Tue, 7 May 2024 23:06:25 +0900 Subject: [PATCH] modified: cm-cli - autosave - update/disable/enable/fix all --- cm-cli.py | 17 +++++++++++++++++ glob/manager_core.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cm-cli.py b/cm-cli.py index 76f00043..5f6f6e17 100644 --- a/cm-cli.py +++ b/cm-cli.py @@ -518,6 +518,10 @@ def save_snapshot(): return core.save_snapshot_with_postfix('snapshot', output_path) +def auto_save_snapshot(): + return core.save_snapshot_with_postfix('cli-autosave') + + def deps_in_workflow(): input_path = None output_path = None @@ -593,6 +597,9 @@ elif op == 'uninstall': for_each_nodes(uninstall_node) elif op == 'update': + if 'all' in nodes: + auto_save_snapshot() + for x in nodes: if x.lower() in ['comfyui', 'comfy', 'all']: update_comfyui() @@ -601,12 +608,21 @@ elif op == 'update': for_each_nodes(update_node, allow_all=True) elif op == 'disable': + if 'all' in nodes: + auto_save_snapshot() + for_each_nodes(disable_node, allow_all=True) elif op == 'enable': + if 'all' in nodes: + auto_save_snapshot() + for_each_nodes(enable_node, allow_all=True) elif op == 'fix': + if 'all' in nodes: + auto_save_snapshot() + for_each_nodes(fix_node, allow_all=True) elif op == 'show': @@ -652,6 +668,7 @@ elif op == 'restore-dependencies': restore_dependencies() elif op == 'install-deps': + auto_save_snapshot() install_deps() elif op == 'clear': diff --git a/glob/manager_core.py b/glob/manager_core.py index 93d5db00..84d4b577 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -22,7 +22,7 @@ sys.path.append(glob_path) import cm_global from manager_util import * -version = [2, 27, 1] +version = [2, 27, 2] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))