From fba25792f9086d2d41b4be2e4c7497bacfdd1894 Mon Sep 17 00:00:00 2001 From: maryhipp Date: Wed, 12 Jul 2023 08:54:42 -0700 Subject: [PATCH] add new route for app config --- invokeai/app/api/routers/app_info.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/invokeai/app/api/routers/app_info.py b/invokeai/app/api/routers/app_info.py index f6466d2b42..08c9a69f37 100644 --- a/invokeai/app/api/routers/app_info.py +++ b/invokeai/app/api/routers/app_info.py @@ -1,5 +1,6 @@ from fastapi.routing import APIRouter from pydantic import BaseModel +from invokeai.backend.image_util.patchmatch import PatchMatch from invokeai.version import __version__ @@ -10,9 +11,19 @@ class AppVersion(BaseModel): """App Version Response""" version: str +class AppConfig(BaseModel): + """App Config Response""" + patchmatch_enabled: bool + @app_router.get('/version', operation_id="app_version", status_code=200, response_model=AppVersion) async def get_version() -> AppVersion: return AppVersion(version=__version__) + +@app_router.get('/config', operation_id="get_config", + status_code=200, + response_model=AppConfig) +async def get_config() -> AppConfig: + return AppConfig(patchmatch_enabled=PatchMatch.patchmatch_available())