diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-18 07:36:11 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-18 07:37:25 +0000 |
commit | ae252cd5bc6daa8295ed1ded8ca101812d0df43b (patch) | |
tree | 7ba3b28a97c57cf79d78b93e5a4172dbb8ca1fc6 | |
parent | 7fd80951ad44e184ff10da8d8daeb38a699477fa (diff) | |
download | stable-diffusion-webui-gfx803-ae252cd5bc6daa8295ed1ded8ca101812d0df43b.tar.gz stable-diffusion-webui-gfx803-ae252cd5bc6daa8295ed1ded8ca101812d0df43b.tar.bz2 stable-diffusion-webui-gfx803-ae252cd5bc6daa8295ed1ded8ca101812d0df43b.zip |
add --gradio-allowed-path commandline option
-rw-r--r-- | modules/cmd_args.py | 1 | ||||
-rw-r--r-- | webui.py | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/cmd_args.py b/modules/cmd_args.py index a533a454..7bde161e 100644 --- a/modules/cmd_args.py +++ b/modules/cmd_args.py @@ -77,6 +77,7 @@ parser.add_argument("--gradio-auth", type=str, help='set gradio authentication l parser.add_argument("--gradio-auth-path", type=str, help='set gradio authentication file path ex. "/path/to/auth/file" same auth format as --gradio-auth', default=None)
parser.add_argument("--gradio-img2img-tool", type=str, help='does not do anything')
parser.add_argument("--gradio-inpaint-tool", type=str, help="does not do anything")
+parser.add_argument("--gradio-allowed-path", action='append', help="add path to gradio's allowed_paths, make it possible to serve files from it")
parser.add_argument("--opt-channelslast", action='store_true', help="change memory type for stable diffusion to channels last")
parser.add_argument("--styles-file", type=str, help="filename to use for styles", default=os.path.join(data_path, 'styles.csv'))
parser.add_argument("--autolaunch", action='store_true', help="open the webui URL in the system's default browser upon launch", default=False)
@@ -329,7 +329,8 @@ def webui(): debug=cmd_opts.gradio_debug,
auth=[tuple(cred.split(':')) for cred in gradio_auth_creds] if gradio_auth_creds else None,
inbrowser=cmd_opts.autolaunch,
- prevent_thread_lock=True
+ prevent_thread_lock=True,
+ allowed_paths=cmd_opts.gradio_allowed_path,
)
if cmd_opts.add_stop_route:
app.add_route("/_stop", stop_route, methods=["POST"])
|