aboutsummaryrefslogtreecommitdiff
path: root/modules/ui.py
diff options
context:
space:
mode:
authorEyeDeck <eyedeck@gmail.com>2022-09-24 09:29:20 -0400
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-24 19:06:36 +0300
commitb5d705e26324e1069e82dda149f7bf494da31142 (patch)
tree80fb8ba443d5081d3dc7b5e95c7adca637cdc754 /modules/ui.py
parenta2bea2f97aab6ef60afe6534611e646f66226868 (diff)
Disable 'batch img2img' when launched with --hide-ui-dir-config
Prevent writing to arbitrary directories, as usual
Diffstat (limited to 'modules/ui.py')
-rw-r--r--modules/ui.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/ui.py b/modules/ui.py
index e0ed26d9..5c355e15 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -578,9 +578,10 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
inpaint_full_res_padding = gr.Slider(label='Inpaint at full resolution padding, pixels', minimum=0, maximum=256, step=4, value=32)
with gr.TabItem('Batch img2img', id='batch'):
- gr.HTML("<p class=\"text-gray-500\">Process images in a directory on the same machine where the server is running.</p>")
- img2img_batch_input_dir = gr.Textbox(label="Input directory")
- img2img_batch_output_dir = gr.Textbox(label="Output directory")
+ hidden = '<br>Disabled when launched with --hide-ui-dir-config.' if shared.cmd_opts.hide_ui_dir_config else ''
+ gr.HTML(f"<p class=\"text-gray-500\">Process images in a directory on the same machine where the server is running.{hidden}</p>")
+ img2img_batch_input_dir = gr.Textbox(label="Input directory", **shared.hide_dirs)
+ img2img_batch_output_dir = gr.Textbox(label="Output directory", **shared.hide_dirs)
with gr.Row():
resize_mode = gr.Radio(label="Resize mode", elem_id="resize_mode", show_label=False, choices=["Just resize", "Crop and resize", "Resize and fill"], type="index", value="Just resize")