From 5851bc839b6f639cda59e84eb1ee8c706986633d Mon Sep 17 00:00:00 2001 From: me <25877290+Kryptortio@users.noreply.github.com> Date: Wed, 4 Jan 2023 22:03:32 +0100 Subject: Add element ids for script components and a few more in ui.py --- scripts/prompts_from_file.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/prompts_from_file.py') diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py index e8386ed2..fc8ddd8a 100644 --- a/scripts/prompts_from_file.py +++ b/scripts/prompts_from_file.py @@ -112,11 +112,13 @@ class Script(scripts.Script): return "Prompts from file or textbox" def ui(self, is_img2img): - checkbox_iterate = gr.Checkbox(label="Iterate seed every line", value=False) - checkbox_iterate_batch = gr.Checkbox(label="Use same random seed for all lines", value=False) + elem_prefix = ('i2i' if is_img2img else 't2i') + '_script_prompt_from_file_' + + checkbox_iterate = gr.Checkbox(label="Iterate seed every line", value=False, elem_id=elem_prefix + "checkbox_iterate") + checkbox_iterate_batch = gr.Checkbox(label="Use same random seed for all lines", value=False, elem_id=elem_prefix + "checkbox_iterate_batch") - prompt_txt = gr.Textbox(label="List of prompt inputs", lines=1) - file = gr.File(label="Upload prompt inputs", type='bytes') + prompt_txt = gr.Textbox(label="List of prompt inputs", lines=1, elem_id=elem_prefix + "prompt_txt") + file = gr.File(label="Upload prompt inputs", type='bytes', elem_id=elem_prefix + "file") file.change(fn=load_prompt_file, inputs=[file], outputs=[file, prompt_txt, prompt_txt]) -- cgit v1.2.3