wip: controlnet

This commit is contained in:
Qing
2023-05-11 21:51:58 +08:00
parent e5ac6a105a
commit 87f54bb87e
10 changed files with 117 additions and 29 deletions

View File

@@ -436,6 +436,17 @@ def switch_model():
return f"ok, switch to {new_name}", 200
@app.route("/controlnet_method", methods=["POST"])
def switch_controlnet_method():
new_method = request.form.get("method")
try:
model.switch_controlnet_method(new_method)
except NotImplementedError:
return f"Failed switch to {new_method} not implemented", 500
return f"Switch to {new_method}", 200
@app.route("/")
def index():
return send_file(os.path.join(BUILD_DIR, "index.html"))