Diffusion Single File
comfyui

Lora training parameters

#106
by sw0ad - opened

I looked at the LoRA parameters that are publicly available and seriously doubt their quality. Most people use 3,000 steps to train a character, seriously? I successfully (almost) trained a style in fewer than 2,000 steps... With that in mind, I'd like to hear advice or even full configuration setups from those who really know what they're doing. Thanks everyone for your responses!

I'm getting the good enough results around ~ 25epochs (~=1500 steps), so I don't train any further (this is for an artstyle btw, with 60 images). However, some models look better, trained a little more or less.

The configuration I use is in this thread: https://huggingface.co/circlestone-labs/Anima/discussions/100#69caa7a87161447e6ad0459c

I'm getting the good enough results around ~ 25epochs (~=1500 steps), so I don't train any further (this is for an artstyle btw, with 60 images). However, some models look better, trained a little higher or lower.

The configuration I use is in this thread: https://huggingface.co/circlestone-labs/Anima/discussions/100#69caa7a87161447e6ad0459c

Yeah, I started with those settings too :)

I had to train a Lycoris rather than a standard LoRA to obtain my desired results via a custom ETS fork that supports Anima, otherwise my results were always subpar. I found that using a Dim of 32 is necessary unlike SDXL, which I train with 16 Dim.

I also found that I only need 16 epochs to train successfully. Anything more than that and the model will just start memorizing the dataset, overfitting entirely.

you guys talk about steps and epoch, but don't say how how many images you have and what is your batch. Which makes it very hard to understand what is your frame of reference.

you guys talk about steps and epoch, but don't say how how many images you have and what is your batch. Which makes it very hard to understand what is your frame of reference.

First and foremost, I'd like to know which optimizers and schedulers other users are using. The number of steps and epochs is much easier to figure out. In most cases, I use 15-50 images for training a character, and 60-400 for a style.

For LoRA training, using a batch size higher than 1 is always recommended to ensure the best possible results. A batch size of 1 will make your training more unreliable, making the model prone to "wander off" during training. I personally use a batch size of 4, as higher batch sizes offer diminishing returns in LoRA training, not to mention that I'd have to adjust the LR to ensure the LoRA doesn't undertrain, as higher batch sizes require higher learning rates. As for the dataset size, I use anywhere from 30-50 images all the way to 500+ depending on the number of concepts/characters I include in the LoRA.

For LoRA training, using a batch size higher than 1 is always recommended to ensure the best possible results. A batch size of 1 will make your training more unreliable, making the model prone to "wander off" during training. I personally use a batch size of 4, as higher batch sizes offer diminishing returns in LoRA training, not to mention that I'd have to adjust the LR to ensure the LoRA doesn't undertrain, as higher batch sizes require higher learning rates. As for the dataset size, I use anywhere from 30-50 images all the way to 500+ depending on the number of concepts/characters I include in the LoRA.

Thank you, I'll make a note of it!

I just trained a model further than 1500 steps to around 3500 steps (same settings as before) and it does produce the style better. However, it does start to "hard shows" the training images in the output, as in, it follows you prompt not as well and looks more like your training images.

I just trained a model further than 1500 steps to around 3500 steps (same settings as before) and it does produce the style better. However, it does start to "hard shows" the training images in the output, as in, it follows you prompt not as well and looks more like your training images.

That's the issue everyone reports about the model forgetting knowledge.
Tdrussel suggested lowering LR and training more, but I still have the issue. It's some architecture issue or the model is under-trained.

I just trained a model further than 1500 steps to around 3500 steps (same settings as before) and it does produce the style better. However, it does start to "hard shows" the training images in the output, as in, it follows you prompt not as well and looks more like your training images.

That's the issue everyone reports about the model forgetting knowledge.
Tdrussel suggested lowering LR and training more, but I still have the issue. It's some architecture issue or the model is under-trained.

Can you send me your full training settings? I've already done several dozen training attempts and I don't think I've ever encountered this... By the way, the style trains many times better than on Illustrious.

I just trained a model further than 1500 steps to around 3500 steps (same settings as before) and it does produce the style better. However, it does start to "hard shows" the training images in the output, as in, it follows you prompt not as well and looks more like your training images.

That's the issue everyone reports about the model forgetting knowledge.
Tdrussel suggested lowering LR and training more, but I still have the issue. It's some architecture issue or the model is under-trained.

That kinda sucks, however, preview 3 just got released, so I'm retraining it with that version. Hopefully it will be better, and even better for the final version of the Anima model, because this has true potential.

Sign up or log in to comment