Overview

15 Fine-tuning Stable Diffusion 1.5

This chapter presents fine-tuning Stable Diffusion 1.5 as a practical “sea change” that can reshape a model’s behavior far more broadly than a LoRA. Rather than manually collecting and labeling images, it shows how AI can be used to help build the training set: one model generates prompts and another, stronger model creates the images, producing a large labeled dataset with minimal effort. The chapter emphasizes that using AI-generated data is not inherently bad; the key is to use it selectively and with enough new information to improve the target model.

The workflow centers on preparing data and configuring OneTrainer for a full fine-tune. The chapter explains how to organize images and captions, then walks through the main training settings: selecting SD 1.5 and the fine-tuning task, choosing a workspace with enough storage, setting the base model and output destination, and optionally reducing file size with lower-precision weights. It also recommends disabling Tensorboard for a first run, creating a concept from a folder of image-text pairs, checking dataset statistics for errors, and setting practical training choices such as 100 epochs, a batch size based on available VRAM, and regular sampling and checkpoint saving so progress can be judged visually and rolled back if needed.

In the results, the fine-tuned model shows meaningful gains across several prompts. It learns to produce much better monster imagery, especially for concepts like sandworms and horror creatures, though some prompts improve more consistently than others and one may even drift away from the intended subject while still becoming visually stronger. The chapter also highlights surprising early gains on unrelated human figures like a space man and a cowboy, where the model quickly cleans up distorted faces and forms. Overall, the takeaway is that fine-tuning is as much an art as a science: the best checkpoint may come before the very end, and the main value lies in iterative experimentation, careful visual judgment, and the ability to keep refining a locally controlled model.

The original Stable Diffusion 1.5 creates an fairly incoherent image.
The result of the fine-tuning we’ll be doing this chapter looks much closer to our prompt
Dall-E 3 knows a lot more about sandworms than SD 1.5
Dall-E creates some pretty compelling images of monsters for us!
Each label/caption for the image is stored in a similarly named .txt file
The first thing we need to do is make sure we’re setup for the right task.
Choose a workspace on a drive with lots of space.
Tensorboard is a great tool, but it’s better to focus on your gut when first learning
We’ll be using base Stable Diffusion 1.5
Setting the destination for our final model to be saved
We can change the type of the output files to reduce the space used.
Creating a new concept in OneTrainer
How our newly created train_data concept looks in the UI
The statistics window helps us quickly verify the quality of our training data.
Setting the Epochs to 100 gives us a chance to see how the fine-tuning evolves over time.
The optimal Local Batch Size depends on your available VRAM.
Sampling is the best way to monitor our progress while training.
We’ll save every 10 epochs to make sure we can choose an earlier checkpoint if we over-train.
This image of a sandworm is... missing the sandworm!
Thankfully we can teach Stable Diffusion what a sandworm is!
While we see changes over time, it’s much harder to say which is the biggest improvement
An image horrific in a way only Stable Diffusion 1.5 can be
The prompt adherence is not great, but the image is pretty cool!
It took essentially the entire training time to produce anything looking coherent
Base SD 1.5 creates a pretty good crab monster out of the box.
None of the fine-tuned version of our crab seem like an unquestionable improvement
An amorphous blob quickly becomes a recognizable space man after just 10 epochs
The quality of our cowboy’s face improves very quickly!

Summary

  • AI can be used to train AI, but there are limitations.
  • The key to avoiding “model collapse” is making sure your AI data has new information.
  • We generally would like at least a few hundred images for fine-tuning.
  • OneTrainer is a multiple purpose tools for a variety of training tasks
  • It’s actually beneficial to “trust your feelings” to assess model performance when generating images
  • Fine-tuning can offer strong improvements very early on in the training process

FAQ

What is fine-tuning in Stable Diffusion 1.5?Fine-tuning is the process of training the model on new data so it fundamentally changes how the model behaves. Unlike a LoRA, fine-tuning affects the whole model, not just a narrow adaptation layer.
Why does this chapter use AI to generate training data?The chapter uses AI to automate the creation of prompts and images, making it possible to produce hundreds of labeled examples quickly with very little manual effort. This also demonstrates how AI can be used to improve AI.
How is the training data created for the fine-tune?A script first asks GPT to generate prompts for chosen subjects and styles, then sends those prompts to Dall-E 3 to generate the actual training images. The result is a dataset of images with matching captions.
How should the generated images and captions be stored?The chapter recommends storing each image with a matching text file that has the same name as the image. This format is simple, widely supported, and allows captions of arbitrary length.
What is OneTrainer used for in this chapter?OneTrainer is the tool used to set up and run the Stable Diffusion 1.5 fine-tuning job. It provides a UI for choosing the model, training task, dataset, sampling, checkpoints, and other training settings.
Which model and task should be selected in OneTrainer?The chapter says to set the model to SD1.5 and the task to Fine Tune. This ensures OneTrainer is configured for full model fine-tuning rather than a different training mode.
Why should Tensorboard be disabled for a first training run?Tensorboard is useful, but it requires extra setup and experience. The chapter also emphasizes that for Stable Diffusion training, visual judgment of samples is often more useful than formal metrics early on.
What training settings are especially important to pay attention to?The chapter highlights epochs, local batch size, sampling frequency, and checkpoint saving frequency. It recommends around 100 epochs for exploration, with sampling and saving every 10 epochs so you can compare results and stop at a good checkpoint.
What kinds of results did the fine-tuning improve most?The biggest improvements were seen in prompts involving monsters, space men, and cowboys. The model learned to generate more coherent subjects, better faces, and stronger composition, especially after only a few epochs.
What is the main takeaway from the chapter’s results?The main takeaway is that fine-tuning can significantly improve Stable Diffusion 1.5, especially for underrepresented subjects and styles. The chapter suggests that the best checkpoint may be somewhere around 20 to 30 epochs, where results were often strongest overall.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Local Image Generation ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Local Image Generation ebook for free