From 605d27687f433c0fefb9025aace7dc94f0ebd454 Mon Sep 17 00:00:00 2001 From: random_thoughtss Date: Tue, 25 Oct 2022 12:20:54 -0700 Subject: Added conditioning image masking to xy_grid. Use `True` and `False` to select values. --- scripts/xy_grid.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index eff0c942..0843adcc 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -153,6 +153,8 @@ def str_permutations(x): """dummy function for specifying it in AxisOption's type when you want to get a list of permutations""" return x +def str_to_bool(x): + return "true" in x.lower().strip() AxisOption = namedtuple("AxisOption", ["label", "type", "apply", "format_value", "confirm"]) AxisOptionImg2Img = namedtuple("AxisOptionImg2Img", ["label", "type", "apply", "format_value", "confirm"]) @@ -178,6 +180,7 @@ axis_options = [ AxisOption("Eta", float, apply_field("eta"), format_value_add_label, None), AxisOption("Clip skip", int, apply_clip_skip, format_value_add_label, None), AxisOption("Denoising", float, apply_field("denoising_strength"), format_value_add_label, None), + AxisOption("Mask Conditioning Image", str_to_bool, apply_field("inpainting_mask_image"), format_value_add_label, None), ] -- cgit v1.2.3 From 8b4f32779f28010fc8077e8fcfb85a3205b36bc2 Mon Sep 17 00:00:00 2001 From: random_thoughtss Date: Tue, 25 Oct 2022 13:15:08 -0700 Subject: Switch to a continous blend for cond. image. --- scripts/xy_grid.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/xy_grid.py b/scripts/xy_grid.py index 0843adcc..f5255786 100644 --- a/scripts/xy_grid.py +++ b/scripts/xy_grid.py @@ -153,9 +153,6 @@ def str_permutations(x): """dummy function for specifying it in AxisOption's type when you want to get a list of permutations""" return x -def str_to_bool(x): - return "true" in x.lower().strip() - AxisOption = namedtuple("AxisOption", ["label", "type", "apply", "format_value", "confirm"]) AxisOptionImg2Img = namedtuple("AxisOptionImg2Img", ["label", "type", "apply", "format_value", "confirm"]) @@ -180,7 +177,7 @@ axis_options = [ AxisOption("Eta", float, apply_field("eta"), format_value_add_label, None), AxisOption("Clip skip", int, apply_clip_skip, format_value_add_label, None), AxisOption("Denoising", float, apply_field("denoising_strength"), format_value_add_label, None), - AxisOption("Mask Conditioning Image", str_to_bool, apply_field("inpainting_mask_image"), format_value_add_label, None), + AxisOption("Cond. Image Mask Weight", float, apply_field("inpainting_mask_weight"), format_value_add_label, None), ] -- cgit v1.2.3 From 315bd7c9e8a20a28fa7fd1ddd5fddbf3b5a9b41c Mon Sep 17 00:00:00 2001 From: Keith Dreibelbis Date: Tue, 1 Nov 2022 19:45:35 -0700 Subject: prompts_from_file: allow random seeds to be preserved for the list of prompts --- scripts/prompts_from_file.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py index 1be22960..8d4911ae 100644 --- a/scripts/prompts_from_file.py +++ b/scripts/prompts_from_file.py @@ -96,6 +96,7 @@ class Script(scripts.Script): def ui(self, is_img2img): checkbox_iterate = gr.Checkbox(label="Iterate seed every line", value=False) + checkbox_iterate_batch = gr.Checkbox(label="Preserve random seed across lines (for use with \"Generate Forever\")", value=False) prompt_txt = gr.Textbox(label="List of prompt inputs", lines=1) file = gr.File(label="Upload prompt inputs", type='bytes') @@ -106,9 +107,9 @@ class Script(scripts.Script): # We don't shrink back to 1, because that causes the control to ignore [enter], and it may # be unclear to the user that shift-enter is needed. prompt_txt.change(lambda tb: gr.update(lines=7) if ("\n" in tb) else gr.update(lines=2), inputs=[prompt_txt], outputs=[prompt_txt]) - return [checkbox_iterate, file, prompt_txt] + return [checkbox_iterate, checkbox_iterate_batch, file, prompt_txt] - def run(self, p, checkbox_iterate, file, prompt_txt: str): + def run(self, p, checkbox_iterate, checkbox_iterate_batch, file, prompt_txt: str): lines = [x.strip() for x in prompt_txt.splitlines()] lines = [x for x in lines if len(x) > 0] @@ -137,7 +138,7 @@ class Script(scripts.Script): jobs.append(args) print(f"Will process {len(lines)} lines in {job_count} jobs.") - if (checkbox_iterate and p.seed == -1): + if ((checkbox_iterate or checkbox_iterate_batch) and p.seed == -1): p.seed = int(random.randrange(4294967294)) state.job_count = job_count -- cgit v1.2.3 From 55688c48806f9383f3a56f6b9a0ab8fbf205edd2 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 2 Nov 2022 07:02:45 +0300 Subject: rename the seed option from #4146 --- scripts/prompts_from_file.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py index 8d4911ae..d187cd9c 100644 --- a/scripts/prompts_from_file.py +++ b/scripts/prompts_from_file.py @@ -96,7 +96,7 @@ class Script(scripts.Script): def ui(self, is_img2img): checkbox_iterate = gr.Checkbox(label="Iterate seed every line", value=False) - checkbox_iterate_batch = gr.Checkbox(label="Preserve random seed across lines (for use with \"Generate Forever\")", value=False) + checkbox_iterate_batch = gr.Checkbox(label="Use same random seed for all lines", value=False) prompt_txt = gr.Textbox(label="List of prompt inputs", lines=1) file = gr.File(label="Upload prompt inputs", type='bytes') @@ -138,7 +138,7 @@ class Script(scripts.Script): jobs.append(args) print(f"Will process {len(lines)} lines in {job_count} jobs.") - if ((checkbox_iterate or checkbox_iterate_batch) and p.seed == -1): + if (checkbox_iterate or checkbox_iterate_batch) and p.seed == -1: p.seed = int(random.randrange(4294967294)) state.job_count = job_count @@ -154,7 +154,7 @@ class Script(scripts.Script): proc = process_images(copy_p) images += proc.images - if (checkbox_iterate): + if checkbox_iterate: p.seed = p.seed + (p.batch_size * p.n_iter) -- cgit v1.2.3