mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
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`...
This commit is contained in:
3
webui.py
3
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__":
|
||||
|
Reference in New Issue
Block a user