From 5997457fd48c9c0fc31c9d96bf0b9c217585c526 Mon Sep 17 00:00:00 2001 From: Yevhenii Hurin Date: Sun, 29 Jan 2023 16:23:29 +0200 Subject: [PATCH] Compact options UI for Prompt Matrix --- scripts/prompt_matrix.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/scripts/prompt_matrix.py b/scripts/prompt_matrix.py index 89db9e63..03212b31 100644 --- a/scripts/prompt_matrix.py +++ b/scripts/prompt_matrix.py @@ -47,16 +47,23 @@ class Script(scripts.Script): return "Prompt matrix" def ui(self, is_img2img): - put_at_start = gr.Checkbox(label='Put variable parts at start of prompt', - value=False, elem_id=self.elem_id("put_at_start")) - different_seeds = gr.Checkbox( - label='Use different seed for each picture', value=False, elem_id=self.elem_id("different_seeds")) - # Radio buttons for selecting the prompt between positive and negative - prompt_type = gr.Radio(["positive", "negative"], label="Select prompt", - elem_id=self.elem_id("prompt_type"), value="positive") - # 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") + gr.HTML('
') + with gr.Row(): + with gr.Column(): + put_at_start = gr.Checkbox(label='Put variable parts at start of prompt', + value=False, elem_id=self.elem_id("put_at_start")) + with gr.Column(): + # Radio buttons for selecting the prompt between positive and negative + prompt_type = gr.Radio(["positive", "negative"], label="Select prompt", + elem_id=self.elem_id("prompt_type"), value="positive") + 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] def run(self, p, put_at_start, different_seeds, prompt_type, variations_delimiter):