{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "ostris-ai-toolkit--train-a-flux-lora-from-a-config-with-ai-toolkit",
 "repo": "ostris/ai-toolkit",
 "repo_url": "https://github.com/ostris/ai-toolkit",
 "repo_slug": "ostris-ai-toolkit",
 "title": "Train a FLUX LoRA from a YAML config",
 "page_title": "How to train a FLUX LoRA from a YAML config with AI Toolkit",
 "summary": "Copy the example FLUX LoRA config, point it at a captioned image folder and run it from the command line.",
 "who": "A creator who wants a model that reproduces their own style or subject.",
 "problem": "Base image models do not know your character, product or art style.",
 "outcome": "A trained LoRA with checkpoints and sample images in an output folder.",
 "steps": [
  "Clone the repo with `git clone https://github.com/ostris/ai-toolkit.git` and `cd ai-toolkit`, then create a venv with `python3 -m venv venv` and `source 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.yaml` into the config folder, edit it following its comments, and run `python run.py config/whatever_you_want.yml`"
 ],
 "agent_prompt": "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.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Advanced",
 "time": "half a day",
 "basis": "readme",
 "caveat": "The README warns that pressing ctrl+c while a checkpoint is saving will likely corrupt it.",
 "category": "Content",
 "tags": [
  "Content"
 ],
 "lang": "",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "legal",
   "notice": "Train only on images you have rights to, and follow the base model's license, such as the FLUX.1-dev terms."
  },
  {
   "tag": "credentials",
   "notice": "Gated models need a Hugging Face read token; keep it out of shared configs."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ostris-ai-toolkit/train-a-flux-lora-from-a-config-with-ai-toolkit/",
 "md": "https://dedupedai.com/use-cases/ostris-ai-toolkit/train-a-flux-lora-from-a-config-with-ai-toolkit/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/ostris-ai-toolkit--train-a-flux-lora-from-a-config-with-ai-toolkit.json",
 "api_version": "v1"
}
