mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
web server now observes --root option
This commit is contained in:
parent
8973ce7d47
commit
891c0f21d5
@ -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.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash
|
||||||
from ldm.invoke.pngwriter import PngWriter, retrieve_metadata
|
from ldm.invoke.pngwriter import PngWriter, retrieve_metadata
|
||||||
from ldm.invoke.prompt_parser import split_weighted_subprompts
|
from ldm.invoke.prompt_parser import split_weighted_subprompts
|
||||||
from ldm.invoke.globals import Globals
|
|
||||||
|
|
||||||
from backend.modules.parameters import parameters_to_command
|
from backend.modules.parameters import parameters_to_command
|
||||||
|
|
||||||
@ -26,6 +25,9 @@ from backend.modules.parameters import parameters_to_command
|
|||||||
opt = Args()
|
opt = Args()
|
||||||
args = opt.parse_args()
|
args = opt.parse_args()
|
||||||
|
|
||||||
|
if not os.path.isabs(args.outdir):
|
||||||
|
args.outdir=os.path.join(args.root_dir,args.outdir)
|
||||||
|
|
||||||
class InvokeAIWebServer:
|
class InvokeAIWebServer:
|
||||||
def __init__(self, generate, gfpgan, codeformer, esrgan) -> None:
|
def __init__(self, generate, gfpgan, codeformer, esrgan) -> None:
|
||||||
self.host = args.host
|
self.host = args.host
|
||||||
@ -74,8 +76,6 @@ class InvokeAIWebServer:
|
|||||||
return {"message": "Server Running"}
|
return {"message": "Server Running"}
|
||||||
|
|
||||||
# Outputs Route
|
# 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.config["OUTPUTS_FOLDER"] = os.path.abspath(args.outdir)
|
||||||
|
|
||||||
@self.app.route("/outputs/<path:file_path>")
|
@self.app.route("/outputs/<path:file_path>")
|
||||||
|
Loading…
Reference in New Issue
Block a user