From b9674e2900f65c0a6d6abc4cd939546658883471 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Tue, 20 Sep 2022 19:07:09 +0300 Subject: add extra generation params --- modules/img2img.py | 2 ++ modules/processing.py | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/img2img.py b/modules/img2img.py index 2dcabc6b..05dbdaf3 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -63,6 +63,8 @@ def img2img(prompt: str, negative_prompt: str, prompt_style: str, prompt_style2: ) print(f"\nimg2img: {prompt}", file=shared.progress_print_out) + p.extra_generation_params["Mask blur"] = mask_blur + if is_upscale: initial_info = None diff --git a/modules/processing.py b/modules/processing.py index e146524d..2bc19f6b 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -70,7 +70,7 @@ class StableDiffusionProcessing: self.tiling: bool = tiling self.do_not_save_samples: bool = do_not_save_samples self.do_not_save_grid: bool = do_not_save_grid - self.extra_generation_params: dict = extra_generation_params + self.extra_generation_params: dict = extra_generation_params or {} self.overlay_images = overlay_images self.paste_to = None self.color_corrections = None @@ -248,8 +248,7 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments, iteration "Denoising strength": getattr(p, 'denoising_strength', None), } - if p.extra_generation_params is not None: - generation_params.update(p.extra_generation_params) + generation_params.update(p.extra_generation_params) generation_params_text = ", ".join([k if k == v else f'{k}: {v}' for k, v in generation_params.items() if v is not None]) -- cgit v1.2.3