aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/cmd_args.py1
-rw-r--r--webui.py5
-rw-r--r--[-rwxr-xr-x]webui.sh0
3 files changed, 6 insertions, 0 deletions
diff --git a/modules/cmd_args.py b/modules/cmd_args.py
index f47c21bb..d906a571 100644
--- a/modules/cmd_args.py
+++ b/modules/cmd_args.py
@@ -102,3 +102,4 @@ parser.add_argument("--no-gradio-queue", action='store_true', help="Disables gra
parser.add_argument("--skip-version-check", action='store_true', help="Do not check versions of torch and xformers")
parser.add_argument("--no-hashing", action='store_true', help="disable sha256 hashing of checkpoints to help loading performance", default=False)
parser.add_argument("--no-download-sd-model", action='store_true', help="don't download SD1.5 model even if no model is found in --ckpt-dir", default=False)
+parser.add_argument('--subpath', type=str, help='customize the subpath for gradio, use with reverse proxy') \ No newline at end of file
diff --git a/webui.py b/webui.py
index 0873a26c..aec9ede0 100644
--- a/webui.py
+++ b/webui.py
@@ -344,6 +344,11 @@ def webui():
print(f"Startup time: {startup_timer.summary()}.")
+ if cmd_opts.subpath:
+ redirector = FastAPI()
+ redirector.get("/")
+ mounted_app = gradio.mount_gradio_app(redirector, shared.demo, path=f"/{cmd_opts.subpath}")
+
wait_on_server(shared.demo)
print('Restarting UI...')
diff --git a/webui.sh b/webui.sh
index 3e069371..3e069371 100755..100644
--- a/webui.sh
+++ b/webui.sh