From cd215700fef8a2baba90dbb788e123b0789b8d79 Mon Sep 17 00:00:00 2001 From: chainchompa Date: Tue, 27 Aug 2024 15:34:07 -0400 Subject: [PATCH] added route for selecting style preset --- invokeai/app/api/routers/style_presets.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/invokeai/app/api/routers/style_presets.py b/invokeai/app/api/routers/style_presets.py index dadd89debb..600cd237db 100644 --- a/invokeai/app/api/routers/style_presets.py +++ b/invokeai/app/api/routers/style_presets.py @@ -53,6 +53,20 @@ async def get_style_preset( return StylePresetRecordWithImage(image=image, **style_preset.model_dump()) except StylePresetNotFoundError: raise HTTPException(status_code=404, detail="Style preset not found") + +@style_presets_router.post( + "/i/{style_preset_id}", + operation_id="set_style_preset", + responses={ + 200: {"model": StylePresetRecordWithImage}, + }, +) +async def select_style_preset( + style_preset_id: str = Path(description="The style preset to select"), +) -> None: + """Selects a style preset, this will be used for saving recently used style presets""" + + return @style_presets_router.patch(