From 5b7633f3c6eaa7ff3c3cdb65303a47d70fc0cf6f Mon Sep 17 00:00:00 2001 From: maryhipp Date: Thu, 22 Feb 2024 09:33:38 -0500 Subject: [PATCH] allow metadata-less models to be used for GET metadata endpoint --- invokeai/app/api/routers/model_manager.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/invokeai/app/api/routers/model_manager.py b/invokeai/app/api/routers/model_manager.py index f57f5f97b6..1b0fafc534 100644 --- a/invokeai/app/api/routers/model_manager.py +++ b/invokeai/app/api/routers/model_manager.py @@ -202,7 +202,7 @@ async def list_model_summary( @model_manager_router.get( - "/meta/i/{key}", + "/i/{key}/meta", operation_id="get_model_metadata", responses={ 200: { @@ -210,7 +210,6 @@ async def list_model_summary( "content": {"application/json": {"example": example_model_metadata}}, }, 400: {"description": "Bad request"}, - 404: {"description": "No metadata available"}, }, ) async def get_model_metadata( @@ -219,8 +218,7 @@ async def get_model_metadata( """Get a model metadata object.""" record_store = ApiDependencies.invoker.services.model_manager.store result: Optional[AnyModelRepoMetadata] = record_store.get_metadata(key) - if not result: - raise HTTPException(status_code=404, detail="No metadata for a model with this key") + return result