diff options
author | winterspringsummer <linoo@naver.com> | 2022-10-20 10:10:32 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-21 04:59:00 +0000 |
commit | 0110429dc4bc004ac56573fe1a6b05cb0123678e (patch) | |
tree | 7a896cc7edd4ce075ade6c54e2ff967c6887676d | |
parent | 7f8ab1ee8f304031b3404e25761dd0f4c7be7df8 (diff) | |
download | stable-diffusion-webui-gfx803-0110429dc4bc004ac56573fe1a6b05cb0123678e.tar.gz stable-diffusion-webui-gfx803-0110429dc4bc004ac56573fe1a6b05cb0123678e.tar.bz2 stable-diffusion-webui-gfx803-0110429dc4bc004ac56573fe1a6b05cb0123678e.zip |
Fixed path issue while extras batch processing
-rw-r--r-- | modules/extras.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/extras.py b/modules/extras.py index b853fa5b..f9796624 100644 --- a/modules/extras.py +++ b/modules/extras.py @@ -118,10 +118,14 @@ def run_extras(extras_mode, resize_mode, image, image_folder, input_dir, output_ while len(cached_images) > 2:
del cached_images[next(iter(cached_images.keys()))]
-
- images.save_image(image, path=outpath, basename="", seed=None, prompt=None, extension=opts.samples_format, info=info, short_filename=True,
- no_prompt=True, grid=False, pnginfo_section_name="extras", existing_info=existing_pnginfo,
- forced_filename=image_name if opts.use_original_name_batch else None)
+
+ if opts.use_original_name_batch and image_name != None:
+ basename = os.path.splitext(os.path.basename(image_name))[0]
+ else:
+ basename = ''
+
+ images.save_image(image, path=outpath, basename=basename, seed=None, prompt=None, extension=opts.samples_format, info=info, short_filename=True,
+ no_prompt=True, grid=False, pnginfo_section_name="extras", existing_info=existing_pnginfo, forced_filename=None)
if opts.enable_pnginfo:
image.info = existing_pnginfo
|