Skip to content

Commit

Permalink
API /sdapi/v1/server-reload-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed Dec 23, 2024
1 parent 04903af commit a56190c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def __init__(self, app: FastAPI, queue_lock: Lock):
self.add_api_route("/sdapi/v1/server-kill", self.kill_webui, methods=["POST"])
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.default_script_arg_txt2img = []
self.default_script_arg_img2img = []
Expand Down Expand Up @@ -926,3 +927,6 @@ def stop_webui(request):
shared.state.server_command = "stop"
return Response("Stopping.")

def reload_webui(self):
shared.state.request_restart()
return Response("Reloading.")

0 comments on commit a56190c

Please sign in to comment.