web server now observes --root option

This commit is contained in:
Lincoln Stein 2022-11-18 05:00:02 +00:00
parent 8973ce7d47
commit 891c0f21d5

View File

@ -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/<path:file_path>")