From cccae9025a3917b5a52f845214c66abdff16adc3 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Wed, 28 Jun 2023 11:01:28 -0400 Subject: [PATCH] fix training messing with tags --- CHANGELOG.md | 7 +++++++ cli/process.py | 3 ++- cli/train.py | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b76502c..652dc8d87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log for SD.Next +- change in behavior + extensions no longer auto-update on startup + using `--upgrade` flag upgrades core app as well as all submodules and extensions +- add live server log monitoring to ui + configurable via settings -> live preview +- add requirements check for training + ## Update for 06/26/2023 - new training tab interface diff --git a/cli/process.py b/cli/process.py index 9f3582114..f20968167 100644 --- a/cli/process.py +++ b/cli/process.py @@ -158,7 +158,7 @@ def interrogate_image(res: Result, tag: str = None): result = sdapi.postsync('/sdapi/v1/interrogate', json) if model == 'clip': caption = result.caption if 'caption' in result else '' - caption = caption.split(',')[0].replace('a ', '') + caption = caption.split(',')[0].replace(' a ', ' ').strip() if tag is not None: caption = res.tag + ', ' + caption if model == 'deepdanbooru': @@ -170,6 +170,7 @@ def interrogate_image(res: Result, tag: str = None): tags.insert(0, t.strip()) pos = 0 if len(tags) == 0 else 1 tags.insert(pos, caption.split(' ')[1]) + tags = [t for t in tags if len(t) > 2] if len(tags) > options.process.tag_limit: tags = tags[:options.process.tag_limit] res.caption = caption diff --git a/cli/train.py b/cli/train.py index c009f0fc8..cf27fbcc8 100755 --- a/cli/train.py +++ b/cli/train.py @@ -112,6 +112,7 @@ def parse_args(): group_other = parser.add_argument_group('Other') group_other.add_argument('--overwrite', default = False, action='store_true', help = "overwrite existing training, default: %(default)s") + group_other.add_argument('--experimental', default = False, action='store_true', help = "enable experimental options, default: %(default)s") group_other.add_argument('--debug', default = False, action='store_true', help = "enable debug level logging, default: %(default)s") args = parser.parse_args() @@ -373,6 +374,9 @@ def process_inputs(): def check_versions(): + if args.experimental: + log.info('experimental mode enabled') + return log.info('checking accelerate') import accelerate if accelerate.__version__ != '0.19.0':