Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix batch img2img output dir with script #12926

Merged
merged 3 commits into from
Sep 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix batch img2img output dir with script
  • Loading branch information
w-e-w committed Aug 31, 2023
commit bd9b3d15e8f631f9475d14a5fd07560c177dc2f3
7 changes: 5 additions & 2 deletions modules/img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args, to_scale=Fal
else:
p.override_settings.pop("sd_model_checkpoint", None)

if output_dir:
p.outpath_samples = output_dir
p.override_settings['save_to_dirs'] = False

proc = modules.scripts.scripts_img2img.run(p, *args)

if proc is None:
if output_dir:
p.outpath_samples = output_dir
p.override_settings['save_to_dirs'] = False
if p.n_iter > 1 or p.batch_size > 1:
p.override_settings['samples_filename_pattern'] = f'{image_path.stem}-[generation_number]'
else:
Expand Down