This is a Docker Setup for Dreambooth to train personalized stable diffusion models.
See wsl2-setup.md for infos about setting up WSL2 and Docker under Windows.
- clone repo
- Build with:
docker compose -f docker-compose.build.yaml build
- register on huggingface and create a new Access Token here: https://huggingface.co/settings/tokens
- copy the token and set it in a file named
.env
in the formTOKEN=yourtoken
. (see alsoexample.env
)
-
make sure the folders
checkpoint_output/
,class_images
andoutput/
are empty before training a new checkpoint.(if they don't exist, they are created on the first start)
-
put training images into
instance_images/
directory. -
edit
app/train.sh
file in a text editor.- only uncomment the type of training you want to use.
- edit
INSTANCE_PROMPT
andCLASS_PROMPT
-
Edit settings in accelerate-config.yaml or run
docker compose -f docker-compose.build.yaml exec dreambooth accelerate config --config_file=/app/examples/dreambooth/accelerate-config.yaml
to configure training acceleration settings.
- run container with
docker compose -f docker-compose.build.yaml up -d
- run
docker compose -f docker-compose.build.yaml exec dreambooth ./train.sh
- get the generated checkpoint file to use with most SD UIs (like https://github.com/AUTOMATIC1111/stable-diffusion-webui) from
checkpoint_output/model.ckpt
.
- open shell into container with:
docker compose -f docker-compose.build.yaml exec dreambooth bash