Skip to content

Commit

Permalink
fix training messing with tags
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmandic committed Jun 28, 2023
1 parent 5a341b1 commit cccae90
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion cli/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions cli/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit cccae90

Please sign in to comment.