diff options
author | SGKoishi <i@sgkoi.dev> | 2022-10-16 17:08:23 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-16 17:59:06 +0000 |
commit | c8045c5ad4f99deb3a19add06e0457de1df62b05 (patch) | |
tree | 25f152c8a366a9ea47fa28ecd3b19409aadb6939 /modules/ui.py | |
parent | 26a11776e4070af30b864ab0ddf25dcda21631a7 (diff) | |
download | stable-diffusion-webui-gfx803-c8045c5ad4f99deb3a19add06e0457de1df62b05.tar.gz stable-diffusion-webui-gfx803-c8045c5ad4f99deb3a19add06e0457de1df62b05.tar.bz2 stable-diffusion-webui-gfx803-c8045c5ad4f99deb3a19add06e0457de1df62b05.zip |
The hide_ui_dir_config flag also restrict write attempt to path settings
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/ui.py b/modules/ui.py index 7b0d5a92..43dc88fc 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -25,7 +25,7 @@ import gradio.routes from modules import sd_hijack, sd_models
from modules.paths import script_path
-from modules.shared import opts, cmd_opts
+from modules.shared import opts, cmd_opts, restricted_opts
if cmd_opts.deepdanbooru:
from modules.deepbooru import get_deepbooru_tags
import modules.shared as shared
@@ -1430,6 +1430,9 @@ Requested path was: {f} if comp_args and isinstance(comp_args, dict) and comp_args.get('visible') is False:
continue
+ if cmd_opts.hide_ui_dir_config and key in restricted_opts:
+ continue
+
oldval = opts.data.get(key, None)
opts.data[key] = value
@@ -1447,6 +1450,9 @@ Requested path was: {f} if not opts.same_type(value, opts.data_labels[key].default):
return gr.update(visible=True), opts.dumpjson()
+ if cmd_opts.hide_ui_dir_config and key in restricted_opts:
+ return gr.update(value=oldval), opts.dumpjson()
+
oldval = opts.data.get(key, None)
opts.data[key] = value
|