From c891a31665758e8255d083af934e3741fb12aed4 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Sat, 5 Jul 2025 08:29:54 -0700 Subject: [PATCH 1/2] fix: resolve FastAPI deprecation warning for example fields Signed-off-by: Emmanuel Ferdman --- invokeai/app/api/routers/images.py | 2 +- invokeai/app/api/routers/model_manager.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/invokeai/app/api/routers/images.py b/invokeai/app/api/routers/images.py index dfc4d63d19d..e9cfa3c28cd 100644 --- a/invokeai/app/api/routers/images.py +++ b/invokeai/app/api/routers/images.py @@ -72,7 +72,7 @@ async def upload_image( resize_to: Optional[str] = Body( default=None, description=f"Dimensions to resize the image to, must be stringified tuple of 2 integers. Max total pixel count: {ResizeToDimensions.MAX_SIZE}", - example='"[1024,1024]"', + examples=['"[1024,1024]"'], ), metadata: Optional[str] = Body( default=None, diff --git a/invokeai/app/api/routers/model_manager.py b/invokeai/app/api/routers/model_manager.py index df938f89b1c..e62a5a5b60d 100644 --- a/invokeai/app/api/routers/model_manager.py +++ b/invokeai/app/api/routers/model_manager.py @@ -292,7 +292,7 @@ async def get_hugging_face_models( ) async def update_model_record( key: Annotated[str, Path(description="Unique key of model")], - changes: Annotated[ModelRecordChanges, Body(description="Model config", example=example_model_input)], + changes: Annotated[ModelRecordChanges, Body(description="Model config", examples=[example_model_input])], ) -> AnyModelConfig: """Update a model's config.""" logger = ApiDependencies.invoker.services.logger @@ -450,7 +450,7 @@ async def install_model( access_token: Optional[str] = Query(description="access token for the remote resource", default=None), config: ModelRecordChanges = Body( description="Object containing fields that override auto-probed values in the model config record, such as name, description and prediction_type ", - example={"name": "string", "description": "string"}, + examples=[{"name": "string", "description": "string"}], ), ) -> ModelInstallJob: """Install a model using a string identifier. From 91701489376652b03eef6173470f3f09e41a8465 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Mon, 7 Jul 2025 04:22:28 -0700 Subject: [PATCH 2/2] fix: resolve FastAPI deprecation warning for example fields Signed-off-by: Emmanuel Ferdman --- invokeai/frontend/web/src/services/api/schema.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.ts index c28c2a9e577..dc6284309e3 100644 --- a/invokeai/frontend/web/src/services/api/schema.ts +++ b/invokeai/frontend/web/src/services/api/schema.ts @@ -22248,16 +22248,6 @@ export interface operations { }; requestBody: { content: { - /** @example { - * "path": "/path/to/model", - * "name": "model_name", - * "base": "sd-1", - * "type": "main", - * "format": "checkpoint", - * "config_path": "configs/stable-diffusion/v1-inference.yaml", - * "description": "Model description", - * "variant": "normal" - * } */ "application/json": components["schemas"]["ModelRecordChanges"]; }; }; @@ -22543,10 +22533,6 @@ export interface operations { }; requestBody: { content: { - /** @example { - * "name": "string", - * "description": "string" - * } */ "application/json": components["schemas"]["ModelRecordChanges"]; }; };