ComfyUI-Manager/modules/migration_server.py
2024-10-05 16:50:26 +09:00

18 lines
537 B
Python

import git
from aiohttp import web
from server import PromptServer
manager_core_path = None
manager_core_url = "https://github.com/Comfy-Org/manager-core"
@PromptServer.instance.routes.get("/manager/install_manager_core")
def install_manager_core(request):
if manager_core_path is not None:
repo = git.Repo.clone_from(manager_core_url, manager_core_path)
repo.git.clear_cache()
repo.close()
else:
print(f"[ComfyUI Manager] Failed to install `manager-core`")
return web.Response(status=200)