diff --git a/launch.py b/launch.py index 0e1bbaf22..af0d418bc 100644 --- a/launch.py +++ b/launch.py @@ -157,7 +157,7 @@ def run_extensions_installers(settings_file): run_extension_installer(os.path.join(dir_extensions, dirname_extension)) -def prepare_enviroment(): +def prepare_environment(): torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113") requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt") commandline_args = os.environ.get('COMMANDLINE_ARGS', "") @@ -291,5 +291,5 @@ def start(): if __name__ == "__main__": - prepare_enviroment() + prepare_environment() start() diff --git a/modules/generation_parameters_copypaste.py b/modules/generation_parameters_copypaste.py index 53f34b0aa..565e342df 100644 --- a/modules/generation_parameters_copypaste.py +++ b/modules/generation_parameters_copypaste.py @@ -122,8 +122,7 @@ def run_bind(): if send_generate_info and paste_fields[tab]["fields"] is not None: if send_generate_info in paste_fields: - paste_field_names = ['Prompt', 'Negative prompt', 'Steps', 'Face restoration', 'Size-1', 'Size-2'] + (["Seed"] if shared.opts.send_seed else []) - + paste_field_names = ['Prompt', 'Negative prompt', 'Steps', 'Face restoration'] + (['Size-1', 'Size-2'] if shared.opts.send_size else []) + (["Seed"] if shared.opts.send_seed else []) button.click( fn=lambda *x: x, inputs=[field for field, name in paste_fields[send_generate_info]["fields"] if name in paste_field_names], diff --git a/modules/shared.py b/modules/shared.py index f53c3303b..4223c017f 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -396,6 +396,7 @@ options_templates.update(options_section(('ui', "User interface"), { "add_model_name_to_info": OptionInfo(False, "Add model name to generation information"), "disable_weights_auto_swap": OptionInfo(False, "When reading generation parameters from text into UI (from PNG info or pasted text), do not change the selected model/checkpoint."), "send_seed": OptionInfo(True, "Send seed when sending prompt or image to other interface"), + "send_size": OptionInfo(True, "Send size when sending prompt or image to another interface"), "font": OptionInfo("", "Font for image grids that have text"), "js_modal_lightbox": OptionInfo(True, "Enable full page image viewer"), "js_modal_lightbox_initially_zoomed": OptionInfo(True, "Show images zoomed in by default in full page image viewer"), diff --git a/scripts/prompt_matrix.py b/scripts/prompt_matrix.py index 5fd952e95..c53ca28cb 100644 --- a/scripts/prompt_matrix.py +++ b/scripts/prompt_matrix.py @@ -46,10 +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) + different_seeds = gr.Checkbox(label='Use different seed for each picture', value=False) - return [put_at_start] + return [put_at_start, different_seeds] - def run(self, p, put_at_start): + 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 @@ -73,7 +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 - 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)