{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "huggingface-peft--train-a-custom-stable-diffusion-style-with-lora",
 "repo": "huggingface/peft",
 "repo_url": "https://github.com/huggingface/peft",
 "repo_slug": "huggingface-peft",
 "title": "Train a custom Stable Diffusion style with LoRA",
 "page_title": "How to train a custom Stable Diffusion style with LoRA with Peft",
 "summary": "Use PEFT LoRA with Diffusers to teach an image model a subject or style on a modest GPU.",
 "who": "An artist or designer who wants a model that reproduces their style or product consistently.",
 "problem": "Full fine-tuning of Stable Diffusion needs about 27.5GB of GPU memory and produces a large checkpoint.",
 "outcome": "A small LoRA checkpoint for Stable Diffusion trained with as little as about 8GB of GPU memory with gradient checkpointing.",
 "steps": [
  "Install PEFT with `pip install peft` and Diffusers",
  "Open the examples/lora_dreambooth/train_dreambooth.py training script from the repo",
  "Prepare a small set of images of your subject or style",
  "Train with LoRA and gradient checkpointing to keep memory low",
  "Load the resulting adapter in Diffusers to generate images"
 ],
 "agent_prompt": "Using huggingface/peft, run examples/lora_dreambooth/train_dreambooth.py on CompVis/stable-diffusion-v1-4 with my images in <folder>, using LoRA and gradient checkpointing. Report peak GPU memory and save the adapter.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The memory numbers in the README are for CompVis/stable-diffusion-v1-4 on an A100; your results will vary.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python with PyTorch and Transformers",
  "A GPU with enough memory for the base model (the README shows a 3B model on far less memory with LoRA)",
  "A dataset for your task"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/huggingface-peft/train-a-custom-stable-diffusion-style-with-lora/",
 "md": "https://dedupedai.com/use-cases/huggingface-peft/train-a-custom-stable-diffusion-style-with-lora/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/huggingface-peft--train-a-custom-stable-diffusion-style-with-lora.json",
 "api_version": "v1"
}
