aboutsummaryrefslogtreecommitdiffstats
path: root/webui.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-05 13:20:40 +0000
committerGitHub <noreply@github.com>2022-11-05 13:20:40 +0000
commit37ba0070ec14d35addf00f6ae88b7b6c7a1c8ae6 (patch)
treebaaf04c26d2bd325d322084ae7fc4ba367836753 /webui.py
parentb8435e632f7ba0da12a2c8e9c788dda519279d24 (diff)
parentc9b2eef6a3b986fafdd1c13a3fb14969cbe909ca (diff)
downloadstable-diffusion-webui-gfx803-37ba0070ec14d35addf00f6ae88b7b6c7a1c8ae6.tar.gz
stable-diffusion-webui-gfx803-37ba0070ec14d35addf00f6ae88b7b6c7a1c8ae6.tar.bz2
stable-diffusion-webui-gfx803-37ba0070ec14d35addf00f6ae88b7b6c7a1c8ae6.zip
Merge branch 'master' into feat/allow-origins
Diffstat (limited to 'webui.py')
-rw-r--r--webui.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/webui.py b/webui.py
index 3788af0b..a5a520f0 100644
--- a/webui.py
+++ b/webui.py
@@ -35,7 +35,7 @@ from modules.shared import cmd_opts
import modules.hypernetworks.hypernetwork
queue_lock = threading.Lock()
-
+server_name = "0.0.0.0" if cmd_opts.listen else cmd_opts.server_name
def wrap_queued_call(func):
def f(*args, **kwargs):
@@ -86,6 +86,20 @@ def initialize():
shared.opts.onchange("sd_hypernetwork", wrap_queued_call(lambda: modules.hypernetworks.hypernetwork.load_hypernetwork(shared.opts.sd_hypernetwork)))
shared.opts.onchange("sd_hypernetwork_strength", modules.hypernetworks.hypernetwork.apply_strength)
+ if cmd_opts.tls_keyfile is not None and cmd_opts.tls_keyfile is not None:
+
+ try:
+ if not os.path.exists(cmd_opts.tls_keyfile):
+ print("Invalid path to TLS keyfile given")
+ if not os.path.exists(cmd_opts.tls_certfile):
+ print(f"Invalid path to TLS certfile: '{cmd_opts.tls_certfile}'")
+ except TypeError:
+ cmd_opts.tls_keyfile = cmd_opts.tls_certfile = None
+ print("TLS setup invalid, running webui without TLS")
+ else:
+ print("Running with TLS")
+
+
# make the program just exit at ctrl+c without waiting for anything
def sigint_handler(sig, frame):
print(f'Interrupted with signal {sig} in {frame}')
@@ -138,8 +152,10 @@ def webui():
app, local_url, share_url = demo.launch(
share=cmd_opts.share,
- server_name="0.0.0.0" if cmd_opts.listen else None,
+ server_name=server_name,
server_port=cmd_opts.port,
+ ssl_keyfile=cmd_opts.tls_keyfile,
+ ssl_certfile=cmd_opts.tls_certfile,
debug=cmd_opts.gradio_debug,
auth=[tuple(cred.split(':')) for cred in cmd_opts.gradio_auth.strip('"').split(',')] if cmd_opts.gradio_auth else None,
inbrowser=cmd_opts.autolaunch,