kohya-ss / kohya-ss/sd-scripts

Tag info saved in model metadata ignores keep_tokens_separator

Open
#2,323 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

Tag info saved in model metadata ignores `keep_tokens_separator`.

For example with `keep_tokens_separator = ##` and caption `1boy##standing, red` the metadata will save tags `1boy##standing, red` while training will use `1boy, standing, red`.
Metadata should also save `1boy, standing, red` in tag frequency.

Probably other caption modifiers are also broken.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the handling of `keep_tokens_separator` and the code that saves tag frequency in model metadata, then compare it with the caption processing used during training. Reproduce the `##` example and verify that metadata records `1boy, standing, red`, while checking whether other caption modifiers follow the same path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.