diff --git a/glob/cnr_utils.py b/glob/cnr_utils.py index ea885f25..060eaa07 100644 --- a/glob/cnr_utils.py +++ b/glob/cnr_utils.py @@ -173,7 +173,10 @@ def read_cnr_info(fullpath): project = data.get('project', {}) name = project.get('name').strip().lower() - version = project.get('version') + + # normalize version + # for example: 2.5 -> 2.5.0 + version = str(manager_util.StrictVersion(project.get('version'))) urls = project.get('urls', {}) repository = urls.get('Repository') diff --git a/glob/manager_core.py b/glob/manager_core.py index 104280b9..d38f5e0f 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, 21, 2] +version_code = [3, 21, 3] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') @@ -513,7 +513,10 @@ class UnifiedManager: if info: cnr = self.cnr_map.get(info['id']) if cnr: - return {'id': cnr['id'], 'cnr': cnr, 'ver': info['version']} + # normalize version + # for example: 2.5 -> 2.5.0 + ver = str(manager_util.StrictVersion(info['version'])) + return {'id': cnr['id'], 'cnr': cnr, 'ver': ver} else: return None else: diff --git a/prestartup_script.py b/prestartup_script.py index d1fd0f13..41a1c085 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -679,6 +679,7 @@ def execute_migration(moves): shutil.move(x[0], x[1]) print(f"[ComfyUI-Manager] MIGRATION: '{x[0]}' -> '{x[1]}'") +script_executed = False # Check if script_list_path exists if os.path.exists(script_list_path): @@ -733,6 +734,7 @@ if os.path.exists(script_list_path): # Remove the script_list_path file if os.path.exists(script_list_path): + script_executed = True os.remove(script_list_path) print("\n[ComfyUI-Manager] Startup script completed.") @@ -744,6 +746,29 @@ del processed_install del pip_fixer manager_util.clear_pip_cache() +if script_executed: + # Restart + print("[ComfyUI-Manager] Restarting to reapply dependency installation.") + + if '__COMFY_CLI_SESSION__' in os.environ: + with open(os.path.join(os.environ['__COMFY_CLI_SESSION__'] + '.reboot'), 'w'): + pass + + print("--------------------------------------------------------------------------\n") + exit(0) + else: + sys_argv = sys.argv.copy() + + if sys.platform.startswith('win32'): + cmds = ['"' + sys.executable + '"', '"' + sys_argv[0] + '"'] + sys_argv[1:] + else: + cmds = [sys.executable] + sys_argv + + print(f"Command: {cmds}", flush=True) + print("--------------------------------------------------------------------------\n") + + os.execv(sys.executable, cmds) + def check_windows_event_loop_policy(): try: diff --git a/pyproject.toml b/pyproject.toml index 08003c0b..2811db5f 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.21.2" +version = "3.21.3" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]