diff --git a/cm-cli.py b/cm-cli.py index d591d268..91279cee 100644 --- a/cm-cli.py +++ b/cm-cli.py @@ -61,13 +61,17 @@ if os.path.exists(os.path.join(manager_util.comfyui_manager_path, "pip_blacklist def check_comfyui_hash(): - repo = git.Repo(comfy_path) - core.comfy_ui_revision = len(list(repo.iter_commits('HEAD'))) + try: + repo = git.Repo(comfy_path) + core.comfy_ui_revision = len(list(repo.iter_commits('HEAD'))) + core.comfy_ui_commit_datetime = repo.head.commit.committed_datetime + except: + print('[bold yellow]INFO: Frozen ComfyUI mode.[/bold yellow]') + core.comfy_ui_revision = 0 + core.comfy_ui_commit_datetime = 0 cm_global.variables['comfyui.revision'] = core.comfy_ui_revision - core.comfy_ui_commit_datetime = repo.head.commit.committed_datetime - check_comfyui_hash() # This is a preparation step for manager_core core.check_invalid_nodes() @@ -250,7 +254,7 @@ def fix_node(node_spec_str, is_all=False, cnt_msg=''): res = unified_manager.unified_fix(node_name, version_spec, no_deps=cmd_ctx.no_deps) if not res.result: - print(f"ERROR: f{res.msg}") + print(f"[bold red]ERROR: f{res.msg}[/bold red]") def uninstall_node(node_spec_str: str, is_all: bool = False, cnt_msg: str = ''): @@ -1043,13 +1047,17 @@ def save_snapshot( ): cmd_ctx.set_user_directory(user_directory) + if output is None: + print("[bold red]ERROR: missing output path[/bold red]") + raise typer.Exit(code=1) + if(not output.endswith('.json') and not output.endswith('.yaml')): - print("ERROR: output path should be either '.json' or '.yaml' file.") + print("[bold red]ERROR: output path should be either '.json' or '.yaml' file.[/bold red]") raise typer.Exit(code=1) dir_path = os.path.dirname(output) if(dir_path != '' and not os.path.exists(dir_path)): - print(f"ERROR: {output} path not exists.") + print(f"[bold red]ERROR: {output} path not exists.[/bold red]") raise typer.Exit(code=1) path = asyncio.run(core.save_snapshot_with_postfix('snapshot', output, not full_snapshot)) diff --git a/glob/manager_core.py b/glob/manager_core.py index 55bb0af7..9426918f 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, 27, 9] +version_code = [3, 27, 10] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') @@ -2590,15 +2590,12 @@ async def get_current_snapshot(custom_nodes_only = False): # Get ComfyUI hash repo_path = comfy_path - if not os.path.exists(os.path.join(repo_path, '.git')): - print("ComfyUI update fail: The installed ComfyUI does not have a Git repository.") - return {} - comfyui_commit_hash = None if not custom_nodes_only: - repo = git.Repo(repo_path) - comfyui_commit_hash = repo.head.commit.hexsha - + if os.path.exists(os.path.join(repo_path, '.git')): + repo = git.Repo(repo_path) + comfyui_commit_hash = repo.head.commit.hexsha + git_custom_nodes = {} cnr_custom_nodes = {} file_custom_nodes = [] diff --git a/pyproject.toml b/pyproject.toml index 9506058f..658507e6 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.27.9" +version = "3.27.10" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions", "toml", "uv", "chardet"]