aboutsummaryrefslogtreecommitdiffstats
path: root/webui.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-07-08 11:53:42 +0000
committerGitHub <noreply@github.com>2023-07-08 11:53:42 +0000
commit211c3398f64b56a9297e831f4662b483793760d6 (patch)
tree6fa260bb6b171fbf2124f4891993789fd384aa91 /webui.py
parent539518292ec4a8a138ddb95195233840311f3ee6 (diff)
parent24d4475bdb623b321bc3fdf7205ae4f3221b6dd5 (diff)
downloadstable-diffusion-webui-gfx803-211c3398f64b56a9297e831f4662b483793760d6.tar.gz
stable-diffusion-webui-gfx803-211c3398f64b56a9297e831f4662b483793760d6.tar.bz2
stable-diffusion-webui-gfx803-211c3398f64b56a9297e831f4662b483793760d6.zip
Merge pull request #11478 from catalpaaa/subpath
Fixing --subpath on newer gradio version
Diffstat (limited to 'webui.py')
-rw-r--r--webui.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/webui.py b/webui.py
index 1b44d4ad..b02ae7a5 100644
--- a/webui.py
+++ b/webui.py
@@ -370,7 +370,11 @@ def api_only():
modules.script_callbacks.app_started_callback(None, app)
print(f"Startup time: {startup_timer.summary()}.")
- api.launch(server_name="0.0.0.0" if cmd_opts.listen else "127.0.0.1", port=cmd_opts.port if cmd_opts.port else 7861)
+ api.launch(
+ server_name="0.0.0.0" if cmd_opts.listen else "127.0.0.1",
+ port=cmd_opts.port if cmd_opts.port else 7861,
+ root_path = f"/{cmd_opts.subpath}"
+ )
def webui():
@@ -409,6 +413,7 @@ def webui():
"docs_url": "/docs",
"redoc_url": "/redoc",
},
+ root_path = f"/{cmd_opts.subpath}",
)
# after initial launch, disable --autolaunch for subsequent restarts
@@ -440,11 +445,6 @@ def webui():
timer.startup_record = startup_timer.dump()
print(f"Startup time: {startup_timer.summary()}.")
- if cmd_opts.subpath:
- redirector = FastAPI()
- redirector.get("/")
- gradio.mount_gradio_app(redirector, shared.demo, path=f"/{cmd_opts.subpath}")
-
try:
while True:
server_command = shared.state.wait_for_server_command(timeout=5)