diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-06-27 06:05:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 06:05:53 +0000 |
commit | 4147fd6b2f905f76c6bc20c3d9de2ea0842fa853 (patch) | |
tree | e7915af4d068912cd8509f1638e05460445a5eea /modules/textual_inversion/preprocess.py | |
parent | f603275d84301b5ee952683e951dd1aad72ba615 (diff) | |
parent | bedcd2f377a38ef4da58c11dbe222d32b954be2f (diff) | |
download | stable-diffusion-webui-gfx803-4147fd6b2f905f76c6bc20c3d9de2ea0842fa853.tar.gz stable-diffusion-webui-gfx803-4147fd6b2f905f76c6bc20c3d9de2ea0842fa853.tar.bz2 stable-diffusion-webui-gfx803-4147fd6b2f905f76c6bc20c3d9de2ea0842fa853.zip |
Merge branch 'dev' into 10141-gradio-user-exif
Diffstat (limited to 'modules/textual_inversion/preprocess.py')
-rw-r--r-- | modules/textual_inversion/preprocess.py | 4 |
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)
|