diff options
author | Sihan Wang <31711261+shwang95@users.noreply.github.com> | 2022-11-02 06:09:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 06:09:33 +0000 |
commit | 5c864be010b42373e51eac4c6869d561adca4202 (patch) | |
tree | 1de5f558ab056bc766ac51d3612356f0de52b1f8 /modules/img2img.py | |
parent | 7bd8581e461623932ffbd5762ee931ee51f798db (diff) | |
parent | 65522ff157e4be4095a99421da04ecb0749824ac (diff) | |
download | stable-diffusion-webui-gfx803-5c864be010b42373e51eac4c6869d561adca4202.tar.gz stable-diffusion-webui-gfx803-5c864be010b42373e51eac4c6869d561adca4202.tar.bz2 stable-diffusion-webui-gfx803-5c864be010b42373e51eac4c6869d561adca4202.zip |
Merge branch 'AUTOMATIC1111:master' into master
Diffstat (limited to 'modules/img2img.py')
-rw-r--r-- | modules/img2img.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/img2img.py b/modules/img2img.py index 86a19f37..be9f3653 100644 --- a/modules/img2img.py +++ b/modules/img2img.py @@ -19,7 +19,7 @@ import modules.scripts def process_batch(p, input_dir, output_dir, args):
processing.fix_seed(p)
- images = [file for file in [os.path.join(input_dir, x) for x in os.listdir(input_dir)] if os.path.isfile(file)]
+ images = shared.listfiles(input_dir)
print(f"Will process {len(images)} images, creating {p.n_iter * p.batch_size} new images for each.")
@@ -55,6 +55,7 @@ def process_batch(p, input_dir, output_dir, args): filename = f"{left}-{n}{right}"
if not save_normally:
+ os.makedirs(output_dir, exist_ok=True)
processed_image.save(os.path.join(output_dir, filename))
@@ -137,6 +138,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro if processed is None:
processed = process_images(p)
+ p.close()
+
shared.total_tqdm.clear()
generation_info_js = processed.js()
|