From 4dd55591622019db050c2dde55a049c0d966fc3e Mon Sep 17 00:00:00 2001 From: ryankashi Date: Thu, 18 May 2023 14:12:01 -0700 Subject: [PATCH] Added the refresh-loras post request --- extensions-builtin/Lora/scripts/lora_script.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions-builtin/Lora/scripts/lora_script.py b/extensions-builtin/Lora/scripts/lora_script.py index 060bda05..0042cbec 100644 --- a/extensions-builtin/Lora/scripts/lora_script.py +++ b/extensions-builtin/Lora/scripts/lora_script.py @@ -76,6 +76,10 @@ def api_loras(_: gr.Blocks, app: FastAPI): @app.get("/sdapi/v1/loras") async def get_loras(): return [create_lora_json(obj) for obj in lora.available_loras.values()] + + @app.post("/sdapi/v1/refresh-loras") + async def refresh_loras(): + return lora.list_available_loras() script_callbacks.on_app_started(api_loras)