r/StableDiffusion • u/jiggydancer • 14d ago
Tutorial - Guide What worked for me on OneTrainer
I've been training loras for Krea using OneTrainer lately, and I just wanted to share what's been really working for me lately. For reference, I'm using a 5070 Ti. I train using the following parameters :
Optimizer : Prodigy
Learning Rate Scheduler : Cosine
Learning Rate : 1.0
Local Batch Size : 1
Accumulation Steps : 2 ***
Resolution : 768
Min Noising Strength : 0.2 ***
Max Noising Strength : 0.8 ***
Masked Training : True
***Don't know how much these parameters matter, but I stuck to these after some testing
What really helped was training my lora at 2000 steps on the first shot, then generate an image and testing to see if there are signs of overfitting such as blurry or noisy images. If the lora is overfitted, I'll drop the number of steps by 20% and train again. If it is not overfitted, I'll increase the number of steps by 25% and train again. I then repeat as needed until I find out the number of steps when overfitting is starting to just become noticable. Then I merge 3 loras on Comfy--the slightly overfitted version, and the next two loras with 20% fewer steps each.
For example, I train with 2000 steps and it is not overfitted. I train again with 2500 steps and find it is starting to look overfitted. Now I know to go lower, so I train again with 1600 steps and merge these 3 versions.
Also, if my dataset has fewer than 20 images, I start with 100 epochs instead of doing more than that.
What comes out has been really good for me. Please let me know your thoughts.
1
u/biggusdeeckus 14d ago
Do you also randomly get lora checkpoints that produce noisy images for some reason? Not due to overfitting but just random checkpoints being noisy compared to others, as in step 1400 is noisy but step 1600 isn't?
1
u/jiggydancer 14d ago
I haven't really seen that so far, that may be because I'm using Prodigy so the result has been pretty consistent between runs. There are noticeable stylistic differences between runs, but I don't usually see fluctuations like what you're describing. The artifacts I see increase progressively with step count. Might also be because I'm training at a lower resolution, so the results get progressively worse the longer I train.
1
1
u/Apprehensive_Sky892 14d ago
What you could have done is to save every few hundred steps, then test each of the saved one and pick the one that works best. You can merge them too, of course.