From 4d34b5a3eea32c49dc924e837e2d355c67e6824f Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 4 Jan 2025 00:59:53 +0900 Subject: [PATCH] fixed: components path not found --- glob/manager_core.py | 2 +- glob/manager_server.py | 35 +++++++++++++++++++---------------- pyproject.toml | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index 05cc7357..f0bc267c 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -36,7 +36,7 @@ import manager_downloader from node_package import InstalledNodePackage -version_code = [3, 3, 3] +version_code = [3, 3, 4] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') diff --git a/glob/manager_server.py b/glob/manager_server.py index c7534884..7678185f 100644 --- a/glob/manager_server.py +++ b/glob/manager_server.py @@ -1338,24 +1338,27 @@ async def save_component(request): @routes.post("/manager/component/loads") async def load_components(request): - try: - json_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.json')] - pack_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.pack')] + if os.path.exists(core.manager_components_path): + try: + json_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.json')] + pack_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.pack')] - components = {} - for json_file in json_files + pack_files: - file_path = os.path.join(core.manager_components_path, json_file) - with open(file_path, 'r') as file: - try: - # When there is a conflict between the .pack and the .json, the pack takes precedence and overrides. - components.update(json.load(file)) - except json.JSONDecodeError as e: - logging.error(f"[ComfyUI-Manager] Error decoding component file in file {json_file}: {e}") + components = {} + for json_file in json_files + pack_files: + file_path = os.path.join(core.manager_components_path, json_file) + with open(file_path, 'r') as file: + try: + # When there is a conflict between the .pack and the .json, the pack takes precedence and overrides. + components.update(json.load(file)) + except json.JSONDecodeError as e: + logging.error(f"[ComfyUI-Manager] Error decoding component file in file {json_file}: {e}") - return web.json_response(components) - except Exception as e: - logging.error(f"[ComfyUI-Manager] failed to load components\n{e}") - return web.Response(status=400) + return web.json_response(components) + except Exception as e: + logging.error(f"[ComfyUI-Manager] failed to load components\n{e}") + return web.Response(status=400) + else: + return web.json_response({}) @routes.get("/manager/version") diff --git a/pyproject.toml b/pyproject.toml index 64a37502..50f6a4ab 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.3.3" +version = "3.3.4" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]