fixed: components path not found

This commit is contained in:
Dr.Lt.Data 2025-01-04 00:59:53 +09:00
parent 32dcedd703
commit 4d34b5a3ee
3 changed files with 21 additions and 18 deletions

View File

@ -36,7 +36,7 @@ import manager_downloader
from node_package import InstalledNodePackage 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 '') version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')

View File

@ -1338,24 +1338,27 @@ async def save_component(request):
@routes.post("/manager/component/loads") @routes.post("/manager/component/loads")
async def load_components(request): async def load_components(request):
try: if os.path.exists(core.manager_components_path):
json_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.json')] try:
pack_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.pack')] 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 = {} components = {}
for json_file in json_files + pack_files: for json_file in json_files + pack_files:
file_path = os.path.join(core.manager_components_path, json_file) file_path = os.path.join(core.manager_components_path, json_file)
with open(file_path, 'r') as file: with open(file_path, 'r') as file:
try: try:
# When there is a conflict between the .pack and the .json, the pack takes precedence and overrides. # When there is a conflict between the .pack and the .json, the pack takes precedence and overrides.
components.update(json.load(file)) components.update(json.load(file))
except json.JSONDecodeError as e: except json.JSONDecodeError as e:
logging.error(f"[ComfyUI-Manager] Error decoding component file in file {json_file}: {e}") logging.error(f"[ComfyUI-Manager] Error decoding component file in file {json_file}: {e}")
return web.json_response(components) return web.json_response(components)
except Exception as e: except Exception as e:
logging.error(f"[ComfyUI-Manager] failed to load components\n{e}") logging.error(f"[ComfyUI-Manager] failed to load components\n{e}")
return web.Response(status=400) return web.Response(status=400)
else:
return web.json_response({})
@routes.get("/manager/version") @routes.get("/manager/version")

View File

@ -1,7 +1,7 @@
[project] [project]
name = "comfyui-manager" 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." 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" } license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"] dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]