From 7dab7c97597c9aa0e666a862619fbf6752519b3d Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Sat, 10 Dec 2022 11:20:43 +0300 Subject: [PATCH] repair #5438 --- scripts/prompt_matrix.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/scripts/prompt_matrix.py b/scripts/prompt_matrix.py index a543d51b3..c53ca28cb 100644 --- a/scripts/prompt_matrix.py +++ b/scripts/prompt_matrix.py @@ -46,11 +46,11 @@ class Script(scripts.Script): def ui(self, is_img2img): put_at_start = gr.Checkbox(label='Put variable parts at start of prompt', value=False) - random_seeds = gr.Checkbox(label='Keep -1 for seeds', value=False) + different_seeds = gr.Checkbox(label='Use different seed for each picture', value=False) - return [put_at_start, random_seeds] + return [put_at_start, different_seeds] - def run(self, p, put_at_start, random_seeds): + def run(self, p, put_at_start, different_seeds): modules.processing.fix_seed(p) original_prompt = p.prompt[0] if type(p.prompt) == list else p.prompt @@ -74,13 +74,7 @@ class Script(scripts.Script): print(f"Prompt matrix will create {len(all_prompts)} images using a total of {p.n_iter} batches.") p.prompt = all_prompts - if random_seeds: - base = p.seed - p.seed = [] - for i in range(len(all_prompts)): - p.seed.append(base+1) - else: - p.seed = [p.seed for _ in all_prompts] + p.seed = [p.seed + (i if different_seeds else 0) for i in range(len(all_prompts))] p.prompt_for_display = original_prompt processed = process_images(p)