Compact options UI for Prompt Matrix

This commit is contained in:
Yevhenii Hurin 2023-01-29 16:23:29 +02:00
parent edabd92729
commit 5997457fd4

View File

@ -47,16 +47,23 @@ class Script(scripts.Script):
return "Prompt matrix" return "Prompt matrix"
def ui(self, is_img2img): def ui(self, is_img2img):
put_at_start = gr.Checkbox(label='Put variable parts at start of prompt', gr.HTML('<br />')
value=False, elem_id=self.elem_id("put_at_start")) with gr.Row():
different_seeds = gr.Checkbox( with gr.Column():
label='Use different seed for each picture', value=False, elem_id=self.elem_id("different_seeds")) put_at_start = gr.Checkbox(label='Put variable parts at start of prompt',
# Radio buttons for selecting the prompt between positive and negative value=False, elem_id=self.elem_id("put_at_start"))
prompt_type = gr.Radio(["positive", "negative"], label="Select prompt", with gr.Column():
elem_id=self.elem_id("prompt_type"), value="positive") # Radio buttons for selecting the prompt between positive and negative
# Radio buttons for selecting the delimiter to use in the resulting prompt prompt_type = gr.Radio(["positive", "negative"], label="Select prompt",
variations_delimiter = gr.Radio(["comma", "space"], label="Select delimiter", elem_id=self.elem_id( elem_id=self.elem_id("prompt_type"), value="positive")
"variations_delimiter"), value="comma") with gr.Row():
with gr.Column():
different_seeds = gr.Checkbox(
label='Use different seed for each picture', value=False, elem_id=self.elem_id("different_seeds"))
with gr.Column():
# Radio buttons for selecting the delimiter to use in the resulting prompt
variations_delimiter = gr.Radio(["comma", "space"], label="Select delimiter", elem_id=self.elem_id(
"variations_delimiter"), value="comma")
return [put_at_start, different_seeds, prompt_type, variations_delimiter] return [put_at_start, different_seeds, prompt_type, variations_delimiter]
def run(self, p, put_at_start, different_seeds, prompt_type, variations_delimiter): def run(self, p, put_at_start, different_seeds, prompt_type, variations_delimiter):