aboutsummaryrefslogtreecommitdiffstats
path: root/modules/textual_inversion/preprocess.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-09 19:42:37 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-09 19:42:37 +0000
commitc8791c1d37502f162b8616b066303bfadc4a749b (patch)
tree6843c3505117f26549dfe1dc9cd40aacd5ccdfd3 /modules/textual_inversion/preprocess.py
parent6fbd85dd0c0dffc06560bff91f4c4b65e441ca5f (diff)
parent31397986e70d20e392d9c3ec70d3aef8ecc2c1ff (diff)
downloadstable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.tar.gz
stable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.tar.bz2
stable-diffusion-webui-gfx803-c8791c1d37502f162b8616b066303bfadc4a749b.zip
Merge branch 'dev' into release_candidate
Diffstat (limited to 'modules/textual_inversion/preprocess.py')
-rw-r--r--modules/textual_inversion/preprocess.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/textual_inversion/preprocess.py b/modules/textual_inversion/preprocess.py
index 4a29151d..da0bcb26 100644
--- a/modules/textual_inversion/preprocess.py
+++ b/modules/textual_inversion/preprocess.py
@@ -63,9 +63,9 @@ def save_pic_with_caption(image, index, params: PreprocessParams, existing_capti
image.save(os.path.join(params.dstdir, f"{basename}.png"))
if params.preprocess_txt_action == 'prepend' and existing_caption:
- caption = existing_caption + ' ' + caption
+ caption = f"{existing_caption} {caption}"
elif params.preprocess_txt_action == 'append' and existing_caption:
- caption = caption + ' ' + existing_caption
+ caption = f"{caption} {existing_caption}"
elif params.preprocess_txt_action == 'copy' and existing_caption:
caption = existing_caption
@@ -174,7 +174,7 @@ def preprocess_work(process_src, process_dst, process_width, process_height, pre
params.src = filename
existing_caption = None
- existing_caption_filename = os.path.splitext(filename)[0] + '.txt'
+ existing_caption_filename = f"{os.path.splitext(filename)[0]}.txt"
if os.path.exists(existing_caption_filename):
with open(existing_caption_filename, 'r', encoding="utf8") as file:
existing_caption = file.read()