Kandinsky LoRA Training
November 25, 2025 ยท View on GitHub
This README provides a quick and practical guide for preparing data, configuring training, and running LoRA fine-tuning for Kandinsky models.
๐ 1. Clone the Repository and Submodule
After clone this repo don't forget do:
git submodule update --init --remote
๐ฅ 2. Download Models
Download all required pretrained models with kandinsky5/download_models.py and place them into:
kandinsky5/weights
๐ฌ 3. Prepare Your Data
Prepare a directory containing pairs:
*.mp4or*.png*.txtโ caption for the same sample
Then:
- Open
encode/encode.sh - Set correct local paths for input data and output directories
- Run:
bash encode/encode.sh
This will generate:
cache/latents_image/cache/text_embeds/
โ๏ธ 4. Configure Training
Choose a config:
- T2I โ
configs/lora_image.yaml - T2V / I2V โ
configs/lora_video.yaml
Update in the selected config:
experiment_dirlog_dircheckpoint_dir
Then edit dataloader configs: configs/data/lora_*_dataloader.yaml.
Set:
latents_dirโ path to latents from Step 3text_embeds_dirโ path to text embeds from Step 3uncond_embedโtext_embeds_dir+/null.pt
๐งฉ 5. GPU & LoRA Setup
Edit:
configs/trainer/lora*.yaml
Configure:
devicesโ number of GPUs- Optional: LoRA architecture parameters
โถ๏ธ 6. Start Training
Choose the correct config inside train.sh:
configs/lora_video.yamlfor T2V / I2Vconfigs/lora_image.yamlfor T2I
Correct --nproc_per_node on your number of GPUs and then run:
bash train.sh
Note: FSDP is enabled by default.