Added the refresh-loras post request

This commit is contained in:
ryankashi 2023-05-18 14:12:01 -07:00
parent 89f9faa633
commit 4dd5559162

View File

@ -76,6 +76,10 @@ def api_loras(_: gr.Blocks, app: FastAPI):
@app.get("/sdapi/v1/loras") @app.get("/sdapi/v1/loras")
async def get_loras(): async def get_loras():
return [create_lora_json(obj) for obj in lora.available_loras.values()] 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) script_callbacks.on_app_started(api_loras)