ostris / ai-toolkit

Various AI scripts. Mostly Stable Diffusion stuff.
MIT License
2.6k stars 251 forks source link

About the choice of optimizer #134

Closed Luckyjjjjjjj closed 1 week ago

Luckyjjjjjjj commented 2 weeks ago

My current work requires me to generate images of dolls as an alternative to photography. The doll itself is nude, and the pictures generated need to reflect body details, so the pictures I provided for training would be more complicated. I found that adamw8bit could not better train FLUX's lora model (it could not be fitted with low learning rate, and the pictures with high learning rate were directly blurred). The prodigy optimizer used in training SDXL before can better get the desired results, can you add prodigy to the trainer?

bearbro95 commented 2 weeks ago

Prodigy is already present

cristian-tapia commented 2 weeks ago

Prodigy is already present

Any hints on how to use it? Just replacing adamw8bit for Prodigy in the optimizer? No extra special params needed?

Thank you!

bearbro95 commented 2 weeks ago
   `lr: 1
    noise_offset: 0.1
    lr_scheduler: "cosine"
    optimizer: "Prodigy"
    optimizer_params:
      decouple: true
      use_bias_correction: False
      betas: [0.9, 0.99]
      weight_decay: 0.05`

  This is what Im using, around 2000 steps for 10 images
cristian-tapia commented 2 weeks ago
   `lr: 1
    noise_offset: 0.1
    lr_scheduler: "cosine"
    optimizer: "Prodigy"
    optimizer_params:
      decouple: true
      use_bias_correction: False
      betas: [0.9, 0.99]
      weight_decay: 0.05`

  This is what Im using, around 2000 steps for 10 images

Awesome, thanks a lot!