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
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 '')

View File

@ -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")

View File

@ -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"]