Use ai-toolkit to train your Flux LoRA on Modal with Gradio UI. No need to setup anything. Just deploy the app and train your LoRA from the UI.
It is useful for training on GPUs with large VRAM like A10G, A100, H100 etc. You can checkout the GPU pricing here.
- Signup for Modal Labs
- Create hugging face token with write access to HuggingFace
- Add token to env variable under the name
HF_TOKEN
to Modal secrets. Use the namehuggingface-secret
for secret - Deploy the app using below commands
# 1. create virtual env (Optional)
python -m venv .venv
source .venv/bin/activate
# 2. install modal
pip install modal
# 3. setup modal - one time setup
modal setup
# 4. deploy the app
modal deploy src/app.py
- Open the app URL in the browser
- Name your LoRA, add trigger keyword, upload your dataset, configure training parameters and start training
- Once training is complete, your LoRA will be saved to HuggingFace repo
If you want to use advanced options during the training, you can refer to this config on ai-toolkit