From 4cdca45228fb0d6f7e664cc3e19b3ce0236bc676 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Wed, 20 Sep 2023 22:53:25 +1000 Subject: [PATCH] feat(api): add route to clear invocation cache --- invokeai/app/api/routers/app_info.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/invokeai/app/api/routers/app_info.py b/invokeai/app/api/routers/app_info.py index afa17d5bd7..a98c8edc6a 100644 --- a/invokeai/app/api/routers/app_info.py +++ b/invokeai/app/api/routers/app_info.py @@ -103,3 +103,13 @@ async def set_log_level( """Sets the log verbosity level""" ApiDependencies.invoker.services.logger.setLevel(level) return LogLevel(ApiDependencies.invoker.services.logger.level) + + +@app_router.delete( + "/invocation_cache", + operation_id="clear_invocation_cache", + responses={200: {"description": "The operation was successful"}}, +) +async def clear_invocation_cache() -> None: + """Clears the invocation cache""" + ApiDependencies.invoker.services.invocation_cache.clear()