lora training

This commit is contained in:
Vladimir Mandic
2023-02-11 17:34:20 -05:00
parent 89502b9552
commit 148c4567d6
21 changed files with 248 additions and 181 deletions
+12
View File
@@ -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)