chapter fifteen

15 Fine-tuning Stable Diffusion 1.5

 

This chapter covers

  • Using OneTrainer to setup training for fine-tuning
  • Creating our own original checkpoint
  • Learning how AI can be used to improve AI
  • Understanding the details of setting up the full configuration for fine-tuning
  • Analyzing our results to understand the benefits and limitations of our fine-tuning
Full fathom five thy father lies;
Of his bones are coral made;
Those are pearls that were his eyes:
Nothing of him that doth fade,
But doth suffer a sea-change
Into something rich and strange.

-- Shakespeare, The Tempest

We start this chapter with a famous passage from Shakespeare’s The Tempest. A fitting quote for our final chapter since The Tempest is often considered Shakespeare’s final play. The quote is also appropriate because in this chapter we will be making fundamental changes to our model by fine-tuning it to hopefully make it better, as “sea change” of our own sort.

Fine-tuning is the process that is used to create all original checkpoints (that aren’t created using the merging technique in the last chapter), where new data fundamentally changes the nature of the entire model. Very similar to training a LoRA, we will collect images and labels, use these to change the model and explore the results to find the ideal place to stop our fine-tuning. Unlike a LoRA we can expect everything about how our model behaves to be affected by the transformation.

15.1 Better Monster Generation

15.2 Generate our Training Data

15.2.1 Using AI to build our training data

15.2.2 Generating our training data

15.2.3 Storing our images and labels

15.3 Setting up OneTrainer for fine-tuning

15.3.1 Installation and running OneTrainer

15.3.2 Getting started and General Settings

15.3.3 Model Settings

15.3.4 Concepts

15.3.5 The training tab

15.3.6 Sampling from the model while fine-tuning

15.3.7 Backing up our model and saving checkpoints

15.4 Running our training job

15.5 Examining the results of our fine-tuning

15.5.1 Exploring our monster generation

15.5.2 Major early improvements in humans

15.6 Conclusion

15.7 Summary