diff options
author | Sj-Si <sjw.jetty@gmail.com> | 2024-01-11 21:37:35 +0000 |
---|---|---|
committer | Sj-Si <sjw.jetty@gmail.com> | 2024-01-11 21:37:35 +0000 |
commit | 036500223de0a3caaa86360a8ad3ed301e4367b0 (patch) | |
tree | f05f0d5fc503d9c35d57bad077a5dab1dfd6569e /modules/postprocessing.py | |
parent | 0726a6e12e85a37d1e514f5603acf9f058c11783 (diff) | |
parent | cb5b335acddd126d4f6c990982816c06beb0d6ae (diff) | |
download | stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.tar.gz stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.tar.bz2 stable-diffusion-webui-gfx803-036500223de0a3caaa86360a8ad3ed301e4367b0.zip |
Merge changes from dev
Diffstat (limited to 'modules/postprocessing.py')
-rw-r--r-- | modules/postprocessing.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/postprocessing.py b/modules/postprocessing.py index 0c59fad4..7449b0dc 100644 --- a/modules/postprocessing.py +++ b/modules/postprocessing.py @@ -2,7 +2,7 @@ import os from PIL import Image
-from modules import shared, images, devices, scripts, scripts_postprocessing, ui_common, generation_parameters_copypaste
+from modules import shared, images, devices, scripts, scripts_postprocessing, ui_common, infotext_utils
from modules.shared import opts
@@ -86,7 +86,7 @@ def run_postprocessing(extras_mode, image, image_folder, input_dir, output_dir, basename = ''
forced_filename = None
- infotext = ", ".join([k if k == v else f'{k}: {generation_parameters_copypaste.quote(v)}' for k, v in pp.info.items() if v is not None])
+ infotext = ", ".join([k if k == v else f'{k}: {infotext_utils.quote(v)}' for k, v in pp.info.items() if v is not None])
if opts.enable_pnginfo:
pp.image.info = existing_pnginfo
@@ -97,11 +97,12 @@ def run_postprocessing(extras_mode, image, image_folder, input_dir, output_dir, if pp.caption:
caption_filename = os.path.splitext(fullfn)[0] + ".txt"
- if os.path.isfile(caption_filename):
+ existing_caption = ""
+ try:
with open(caption_filename, encoding="utf8") as file:
existing_caption = file.read().strip()
- else:
- existing_caption = ""
+ except FileNotFoundError:
+ pass
action = shared.opts.postprocessing_existing_caption_action
if action == 'Prepend' and existing_caption:
|