Skip to content

Commit

Permalink
API /sdapi/v1/server-reload-script-bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed Dec 23, 2024
1 parent a56190c commit 60efbc4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def __init__(self, app: FastAPI, queue_lock: Lock):
self.add_api_route("/sdapi/v1/server-restart", self.restart_webui, methods=["POST"])
self.add_api_route("/sdapi/v1/server-stop", self.stop_webui, methods=["POST"])
self.add_api_route("/sdapi/v1/server-reload-ui", self.reload_webui, methods=["POST"])
self.add_api_route("/sdapi/v1/server-reload-script-bodies", self.reload_script_bodies, methods=["POST"])

self.default_script_arg_txt2img = []
self.default_script_arg_img2img = []
Expand Down Expand Up @@ -930,3 +931,7 @@ def stop_webui(request):
def reload_webui(self):
shared.state.request_restart()
return Response("Reloading.")

def reload_script_bodies(self):
scripts.reload_script_body_only()
return Response("Reload script bodies.")

0 comments on commit 60efbc4

Please sign in to comment.