add migration code
This commit is contained in:
17
modules/migration_server.py
Normal file
17
modules/migration_server.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user