Stable Diffusion CLI
Install the CLI tool:
Get help to use the cli:
Training requirements
- kohya_ss: Follow the installation guidelines here https://github.com/bmaltais/kohya_ss.
Setup the training environment:
Examples
Generation example
To generate an image, simply run:
To check all the generation parameters:
Training example
We have a dataset with photos of Bacana, a Coton de Tuléar, conceptualized as bacana white dog to not mix with the existing Coton de Tuléar concept in the Stable Diffusion XL model.
Some of the training images in examples/training/lora/bacana/images:
The training parameters looks like this:
Note that the output.name is a format string that captures the parameters values. This is useful for experimenting with different parameters and keeping track of them in the model file name.
Train the example with:
The LoRA safetensor file will be generated as
)
)
Where, in this case, bacana(white dog)d8a1-000001.safetensors is the first epoch and bacana(white dog)d8a1.safetensors is the final epoch.
You can then
and run
to test image generation with the LoRA model. The generated images will be present in examples/training/lora/bacana/generation.
Some of the generated images:
Development tips
Debugging
To check the training folder structure required by kohya_ss set the TRAINING_DIR to, for example, ./training like:
TRAINING_DIR=./training stable-diffusion train ...