aboutsummaryrefslogtreecommitdiff
path: root/webui.py
diff options
context:
space:
mode:
authorEyeDeck <eyedeck@gmail.com>2022-09-12 08:08:41 -0400
committerEyeDeck <eyedeck@gmail.com>2022-09-12 08:08:41 -0400
commite3646e79aa4d1694c463be648201498a2f1091da (patch)
tree5c890670f0b6bc477dc909b4cf28a1f1c022f881 /webui.py
parentab87ff0100d28088fc1d12d99e37948c2c59e462 (diff)
Add --auth command line argument to enable Gradio authentication
Allows you to pass in Gradio authentication like: `--auth username:password` Supports multiple sets of credentials by comma-delimiting, like: `--auth user1:pass1,user2:pass3`...
Diffstat (limited to 'webui.py')
-rw-r--r--webui.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/webui.py b/webui.py
index 35c8362b..2b8dedc7 100644
--- a/webui.py
+++ b/webui.py
@@ -115,7 +115,8 @@ def webui():
run_pnginfo=modules.extras.run_pnginfo
)
- demo.launch(share=cmd_opts.share, server_name="0.0.0.0" if cmd_opts.listen else None, server_port=cmd_opts.port, debug=cmd_opts.gradio_debug)
+ auth = [tuple(cred.split(':')) for cred in cmd_opts.auth.strip('"').split(',')] if cmd_opts.auth else None
+ demo.launch(share=cmd_opts.share, server_name="0.0.0.0" if cmd_opts.listen else None, server_port=cmd_opts.port, debug=cmd_opts.gradio_debug, auth=auth)
if __name__ == "__main__":