kohya-ss / kohya-ss/sd-scripts
Correct way of doing regularization and naming regularization images
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
Thanks for sharing the tool and it is super useful for training SD models, LoRA and embeddings!
I have some questions regarding improving the quality of LoRA with regularization images. I have gone through some existing issues about regularization like this: https://github.com/kohya-ss/sd-scripts/issues/449, however, I still want to clarify some details.
I saw some bloggers sharing their experience on using regularization to improve their LoRA, and some of them suggest to match the regularization image names with training images. For example, when training a LoRA of a certain person, if the training images are: **_some_body_1.png, some_body_1.txt (tags), some_body_2.png, some_body_2.txt (tags), ..., some_body_n.png, some_body_n.txt (tags)_**, then define the regularization images like: **_some_body_1.png, some_body_2.png, ..., some_body_n.png_** (in the regularization folder) as well. The purpose of this is to tell the mapping between training images and reg image, e.g. which reg image to use for a given training image.
However, after quickly looking through the docs some high-level code, I'm not sure if the names of regularization images really matter. It seems to me that after enabling regularization, it doubles the training steps of each training image, and the choice of regularization image for a given training image is random (could be anyone from the pool of regularization images). Could you please clarify the logic of regularization and correct my understanding if it is wrong? I really appreciate it if you could shed some light on this.
Again, thank you very much for sharing this great tool with the community!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the documentation and the regularization-related high-level code mentioned in the issue. Trace how regularization images are selected and whether filenames establish a mapping, then document the confirmed behavior and correct any misleading guidance about naming.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100