legal. Train only on images you have rights to, and follow the base model's license, such as the FLUX.1-dev terms.
Credentials. Gated models need a Hugging Face read token; keep it out of shared configs.
Who it is forA creator who wants a model that reproduces their own style or subject.
The problemBase image models do not know your character, product or art style.
The outcomeA trained LoRA with checkpoints and sample images in an output folder.
What you need first
- Python >= 3.10 (3.12 recommended), git and a Python venv
- An Nvidia GPU with enough memory for the model you train (example configs target 24GB)
- Node.js > 20 for the web UI, and a Hugging Face token for gated models such as FLUX.1-dev
Steps
- Clone the repo with
git clone https://github.com/ostris/ai-toolkit.gitandcd ai-toolkit, then create a venv withpython3 -m venv venvandsource venv/bin/activate - Install torch as the README shows, then
pip3 install -r requirements.txt - Prepare a dataset folder of jpg, jpeg or png images, each with a .txt caption file of the same name
- Copy
config/examples/train_lora_flux_24gb.yamlinto the config folder, edit it following its comments, and runpython run.py config/whatever_you_want.yml
Prompt for your agent
Using ostris/ai-toolkit, set up the venv, build a captioned dataset from <my image folder>, copy train_lora_flux_24gb.yaml into config with my dataset path and a trigger word, and start training with python run.py.
Caveat. The README warns that pressing ctrl+c while a checkpoint is saving will likely corrupt it.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for ostris/ai-toolkit and "Train a FLUX LoRA from a YAML config"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer