The training code for Stable Diffusion 1.5 and XL. This code is based on latent-consistency-model.
conda create -n icd-train python=3.10 -y
conda activate icd-train
pip3 install -r requirements.txt
We provide the training example on the MS-COCO dataset: train2014.tar.gz - contains the original COCO2014 train set.
- Download the train dataset:
bash data/download_coco_train2014.sh
- Download the validation dataset:
bash data/download_coco_val2014.sh
- Download the files for FID calculation:
bash stats/download_fid_files.sh
- Download the pretrained CFG distilled teacher:
bash pretrained/download_cfg_distill_sd15.sh
orbash pretrained/download_cfg_distill_sdxl.sh
- Run the training:
bash sh_scripts/run_sd15_lora.sh
orbash sh_scripts/run_sdxl_lora.sh
Model | Batch size | LR | Max train steps | Preserve loss coefs |
---|---|---|---|---|
iCD-SD1.5 | 512 | 8e-6 | 6000 | 1.5, 1.5 |
iCD-XL | 128 | 8e-6 | 6000 | 1.5, 1.5 |