aboutsummaryrefslogtreecommitdiffstats
path: root/modules/textual_inversion/preprocess.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-06-27 05:38:14 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-06-27 05:38:14 +0000
commit394ffa7b0a7fff3ec484bcd084e673a8b301ccc8 (patch)
treeb0e9b9d93f90b5d50084292a48578bd4f9a83ec6 /modules/textual_inversion/preprocess.py
parentbaf6946e06249c5af9851c60171692c44ef633e0 (diff)
parentdbc88c96450793b08b520f3b86cd46d6aeaaae52 (diff)
downloadstable-diffusion-webui-gfx803-394ffa7b0a7fff3ec484bcd084e673a8b301ccc8.tar.gz
stable-diffusion-webui-gfx803-394ffa7b0a7fff3ec484bcd084e673a8b301ccc8.tar.bz2
stable-diffusion-webui-gfx803-394ffa7b0a7fff3ec484bcd084e673a8b301ccc8.zip
Merge branch 'release_candidate'
Diffstat (limited to 'modules/textual_inversion/preprocess.py')
-rw-r--r--modules/textual_inversion/preprocess.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/textual_inversion/preprocess.py b/modules/textual_inversion/preprocess.py
index a009d8e8..0d4c3f84 100644
--- a/modules/textual_inversion/preprocess.py
+++ b/modules/textual_inversion/preprocess.py
@@ -47,7 +47,7 @@ def save_pic_with_caption(image, index, params: PreprocessParams, existing_capti
caption += shared.interrogator.generate_caption(image)
if params.process_caption_deepbooru:
- if len(caption) > 0:
+ if caption:
caption += ", "
caption += deepbooru.model.tag_multi(image)
@@ -67,7 +67,7 @@ def save_pic_with_caption(image, index, params: PreprocessParams, existing_capti
caption = caption.strip()
- if len(caption) > 0:
+ if caption:
with open(os.path.join(params.dstdir, f"{basename}.txt"), "w", encoding="utf8") as file:
file.write(caption)