13 Training a Flux LoRA
This chapter covers
- Using the AI-Toolkit to train a LoRA
- Best practices for collecting custom data for training
- How to label your data to get the best results
- Tips on settings for running your training job
- Understanding how the sample images generated in training allow you to pick the best checkpoint
“Was it a vision, or a waking dream?
Fled is that music:—Do I wake or sleep?”
-- John Keats, Ode to a Nightingale
In Chapter 11 we introduced LoRAs as a solution to the problem of adding style or custom concepts to images generated using Stable Diffusion or Flux. Recall that LoRAs are small models that modify key parts of the diffusion model to get customized results without needing to fine-tune the entire model. One of our subject LoRAs involved my dog Keats, namesake of the author of this chapter’s quote. In this chapter we’ll learn how to create that LoRA. This chapter also will touch on many important topics related to training machine learning models in general: how to collect and select training data, labeling of data, and understanding the strengths and weaknesses of a particular model by exploring the results of our training.
Keats (the dog) is a particularly interesting subject as he is a rather unique breed of dog: a Silken Windhound. In figure 13.1 you can see Keats standing in a chair looking out the window:
Figure 13.1 Keats staring at the window waiting for family to return