diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-02-19 10:11:48 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-02-19 10:11:48 +0000 |
commit | d84f3cf7a7743bc91cd5ba524c76cf859e021b49 (patch) | |
tree | 4b84455e5145d73c558a70850e859b83506faacc | |
parent | c3d5a6ed37c164c626d938ead9c7f12dc1233804 (diff) | |
download | stable-diffusion-webui-gfx803-d84f3cf7a7743bc91cd5ba524c76cf859e021b49.tar.gz stable-diffusion-webui-gfx803-d84f3cf7a7743bc91cd5ba524c76cf859e021b49.tar.bz2 stable-diffusion-webui-gfx803-d84f3cf7a7743bc91cd5ba524c76cf859e021b49.zip |
split #7300 into multiple lines
-rw-r--r-- | webui.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -207,6 +207,14 @@ def webui(): if cmd_opts.gradio_queue:
shared.demo.queue(64)
+ gradio_auth_creds = []
+ if cmd_opts.gradio_auth:
+ gradio_auth_creds += cmd_opts.gradio_auth.strip('"').replace('\n', '').split(',')
+ if cmd_opts.gradio_auth_path:
+ with open(cmd_opts.gradio_auth_path, 'r', encoding="utf8") as file:
+ for line in file.readlines():
+ gradio_auth_creds += [x.strip() for x in line.split(',')]
+
app, local_url, share_url = shared.demo.launch(
share=cmd_opts.share,
server_name=server_name,
@@ -214,7 +222,7 @@ def webui(): 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('"').replace('\n','').split(',') + (open(cmd_opts.gradio_auth_path, 'r').read().strip().replace('\n','').split(',') if cmd_opts.gradio_auth_path and os.path.exists(cmd_opts.gradio_auth_path) else None))] if cmd_opts.gradio_auth or (cmd_opts.gradio_auth_path and os.path.exists(cmd_opts.gradio_auth_path)) else None,
+ auth=[tuple(cred.split(':')) for cred in gradio_auth_creds] if gradio_auth_creds else None,
inbrowser=cmd_opts.autolaunch,
prevent_thread_lock=True
)
|