diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-06 17:30:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 17:30:29 +0000 |
commit | ab4ddbf333eef170804ef8de67001f77c8fdd64c (patch) | |
tree | 21cb1109f8eae463aa4066eec0926cd71ab81740 /modules/img2img.py | |
parent | 2a7f48cdb8dcf9acb02610cccae0d1ee5d260bc2 (diff) | |
parent | cf7c784fcc0c84a8a4edd8d3aca4dda4c7025c43 (diff) | |
download | stable-diffusion-webui-gfx803-ab4ddbf333eef170804ef8de67001f77c8fdd64c.tar.gz stable-diffusion-webui-gfx803-ab4ddbf333eef170804ef8de67001f77c8fdd64c.tar.bz2 stable-diffusion-webui-gfx803-ab4ddbf333eef170804ef8de67001f77c8fdd64c.zip |
Merge branch 'master' into gallery-styling
Diffstat (limited to 'modules/img2img.py')
-rw-r--r-- | modules/img2img.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/img2img.py b/modules/img2img.py index 03e934e9..da212d72 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -23,8 +23,10 @@ def process_batch(p, input_dir, output_dir, args): print(f"Will process {len(images)} images, creating {p.n_iter * p.batch_size} new images for each.")
+ save_normally = output_dir == ''
+
p.do_not_save_grid = True
- p.do_not_save_samples = True
+ p.do_not_save_samples = not save_normally
state.job_count = len(images) * p.n_iter
@@ -48,7 +50,8 @@ def process_batch(p, input_dir, output_dir, args): left, right = os.path.splitext(filename)
filename = f"{left}-{n}{right}"
- processed_image.save(os.path.join(output_dir, filename))
+ if not save_normally:
+ processed_image.save(os.path.join(output_dir, filename))
def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, prompt_style2: str, init_img, init_img_with_mask, init_img_inpaint, init_mask_inpaint, mask_mode, steps: int, sampler_index: int, mask_blur: int, inpainting_fill: int, restore_faces: bool, tiling: bool, n_iter: int, batch_size: int, cfg_scale: float, denoising_strength: float, seed: int, subseed: int, subseed_strength: float, seed_resize_from_h: int, seed_resize_from_w: int, seed_enable_extras: bool, height: int, width: int, resize_mode: int, inpaint_full_res: bool, inpaint_full_res_padding: int, inpainting_mask_invert: int, img2img_batch_input_dir: str, img2img_batch_output_dir: str, *args):
@@ -103,7 +106,9 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro inpaint_full_res_padding=inpaint_full_res_padding,
inpainting_mask_invert=inpainting_mask_invert,
)
- print(f"\nimg2img: {prompt}", file=shared.progress_print_out)
+
+ if shared.cmd_opts.enable_console_prompts:
+ print(f"\nimg2img: {prompt}", file=shared.progress_print_out)
p.extra_generation_params["Mask blur"] = mask_blur
@@ -124,4 +129,7 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro if opts.samples_log_stdout:
print(generation_info_js)
+ if opts.do_not_show_images:
+ processed.images = []
+
return processed.images, generation_info_js, plaintext_to_html(processed.info)
|