From 7b0bce916e78d87d3e201a82ce644c60ebde997f Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Wed, 17 Apr 2024 23:54:39 +0900 Subject: [PATCH] feat: add api - /snapshot/get_current --- __init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index c3b7f0f..fd8b291 100644 --- a/__init__.py +++ b/__init__.py @@ -19,7 +19,7 @@ from server import PromptServer from .glob import manager_core as core import cm_global -version = [2, 18, 4] +version = [2, 19] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') print(f"### Loading: ComfyUI-Manager ({version_str})") @@ -541,6 +541,12 @@ async def fetch_externalmodel_list(request): return web.json_response(json_obj, content_type='application/json') +@PromptServer.instance.routes.get("/snapshot/get_current") +async def get_snapshot_list(request): + json_obj = get_current_snapshot() + return web.json_response(json_obj, content_type='application/json') + + @PromptServer.instance.routes.get("/snapshot/getlist") async def get_snapshot_list(request): snapshots_directory = os.path.join(os.path.dirname(__file__), 'snapshots')