mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
lora training
This commit is contained in:
@@ -150,6 +150,7 @@ class Api:
|
||||
self.add_api_route("/sdapi/v1/train/embedding", self.train_embedding, methods=["POST"], response_model=TrainResponse)
|
||||
self.add_api_route("/sdapi/v1/train/hypernetwork", self.train_hypernetwork, methods=["POST"], response_model=TrainResponse)
|
||||
self.add_api_route("/sdapi/v1/memory", self.get_memory, methods=["GET"], response_model=MemoryResponse)
|
||||
self.add_api_route("/sdapi/v1/shutdown", self.shutdown, methods=["POST"])
|
||||
|
||||
def add_api_route(self, path: str, endpoint, **kwargs):
|
||||
if shared.cmd_opts.api_auth:
|
||||
@@ -175,6 +176,17 @@ class Api:
|
||||
script = script_runner.selectable_scripts[script_idx]
|
||||
return script, script_idx
|
||||
|
||||
def shutdown(self):
|
||||
print('shutdown request received')
|
||||
# from modules.shared import demo
|
||||
# demo.close()
|
||||
# time.sleep(0.5)
|
||||
# import sys
|
||||
# sys.exit(0)
|
||||
import os
|
||||
os._exit(0)
|
||||
|
||||
|
||||
def text2imgapi(self, txt2imgreq: StableDiffusionTxt2ImgProcessingAPI):
|
||||
script, script_idx = self.get_script(txt2imgreq.script_name, scripts.scripts_txt2img)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user