kohya-ss / kohya-ss/sd-scripts
I have a few experiments I'd like to run training FLUX using weighted captions.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
One of the largest issues with flux is overfitting certain captions over others. Words like the, and, and so on, all end up overfitted when adjusting the primary core attributes of the system using subject and character augmentation captions and class tags. They often breach the entire style point when creating loras, completely overwhelming the base model's style and destroying perfectly useful context with almost no training, forcing the base model to conform to IT rather than the other way around. Now, this may be at least somewhat of a goal for many, this isn't fitting for finetuning on a larger scale with considerably more images that have many unaccounted for and unseen random elements.
My experiments require the ability to tune down values based on caption to word ratio in the overall dataset. My assessment of the initial trainings show promising findings in this direction. Simple support for this will likely be enough for me to cobble something together.
The secondary element to my experiments involve the ability to drop entire images and image tag classes from the training when certain thresholds are met within the caption weighting. This will potentially cut down on large amounts of flux training and reduce overfitting to a large degree. This one will require some tinkering and threshold checking to ensure the experiments will produce useful information based on the original dreambooth concept without omitting useful and necessary context from the important conjunction context datas.
https://dreambooth.github.io/
The third element to my experiments would be into introduce segmented latents based on segmentation using onnx and class identifier elements with area defining parameters prepared pre-training as latents and then bucketed for supplementary options. Onnx models are quite fast, and I assume that bucketing the images to their native resolution would allow for supplementation of the lesser class elements within the training information, using onnx prepared bboxes and informational supplementation during training time. Essentially allowing the use of a more "subject fixation" crop for supplemented data with weighted captioning and auto-tuned weighted captions of the lesser elements and lesser classes, deciding the strength and importance of the subject fixated elements and classes. This DOES show promise in smaller scale tests, however once the image count gets too high, defaulting to the concept of weighted captions would reduce a lot of over-training and iterations passing over latents that it simply should be omitting entirely.
https://github.com/onnx/models
For example; the math to normalize my particular dataset of 350,000 images is about 5 billion images using repeats. The caption strength concept here significantly reduces the overall footprint of the image counts, and even allows for a threshold reduction to a much smaller value based on the outcome and shared tag normalizations. If possible, I'd rather attain an achievable experiment within this century. Conceptually, this concept is intended to reduce the image count to nearly the identical amount of images as what is presented already, within a caption buffer rate threshold of 20% or less, which in my case is about +-0.2 * 350,000 images without requiring a single identical repeat.
The primary issues present themselves when you start overfitting and burning out the original elements in FLUX, and I think a lot of these problems can be automatically tuned based on the dataset's dreambooth captioning and class_id dropping and tuning. I'd like to run a series of experiments with these, and support for weighted captions would help a lot with these experiments. Since weighted captions are already implemented in a lesser extent for SD1.5, it seems to be a prime candidate for a request.
In any case, if the weighted captions are the key, the outcome will present itself in my published findings whether good or not.
Also, I apologize for my terrible use of grammar. I'm an engineer and logician, so my English fell to side at some point.
Contributor guide
No contributing guide indexed for this repository
Research direction
No files, tests, or entry points are named. Start by locating the existing SD1.5 weighted-caption implementation and the FLUX training path, then narrow the request to a defined experiment with measurable caption-weighting and image-dropping thresholds. Done would require an agreed scope and validation results for the proposed training behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100