From 891c0f21d50524480746489f2776ec4619c27dac Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 18 Nov 2022 05:00:02 +0000 Subject: [PATCH] web server now observes --root option --- backend/invoke_ai_web_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/invoke_ai_web_server.py b/backend/invoke_ai_web_server.py index 88b8d89ffc..469a6ed5d2 100644 --- a/backend/invoke_ai_web_server.py +++ b/backend/invoke_ai_web_server.py @@ -17,7 +17,6 @@ from threading import Event from ldm.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash from ldm.invoke.pngwriter import PngWriter, retrieve_metadata from ldm.invoke.prompt_parser import split_weighted_subprompts -from ldm.invoke.globals import Globals from backend.modules.parameters import parameters_to_command @@ -26,6 +25,9 @@ from backend.modules.parameters import parameters_to_command opt = Args() args = opt.parse_args() +if not os.path.isabs(args.outdir): + args.outdir=os.path.join(args.root_dir,args.outdir) + class InvokeAIWebServer: def __init__(self, generate, gfpgan, codeformer, esrgan) -> None: self.host = args.host @@ -74,8 +76,6 @@ class InvokeAIWebServer: return {"message": "Server Running"} # Outputs Route - if not os.path.isabs(args.outdir): - args.outdir=os.path.join(Globals.root,args.outdir) self.app.config["OUTPUTS_FOLDER"] = os.path.abspath(args.outdir) @self.app.route("/outputs/")