FLUX.1 LoRA Training Parameters: The Settings That Matter
FLUX.1 LoRA training parameters explained: dataset prep, captioning, learning rate, network dim and alpha, and VRAM for 12GB–24GB GPUs.
On this page
- Is Flux a UNet or a transformer?
- How many images do you need for a Flux LoRA?
- Dataset preparation and aspect bucketing
- Captioning for Flux LoRAs
- What network dim and alpha should you use for a Flux LoRA?
- What learning rate for Flux LoRA training?
- Does Flux LoRA training use clip_skip, min_snr_gamma, or noise_offset?
- How much VRAM do I need to train a Flux LoRA?
- Batch size, repeats, and steps
- Common errors and fixes
- FAQ
- Sources
FLUX.1 LoRA Training Parameters: The Settings That Matter
FLUX.1 is a 12-billion-parameter flow-matching diffusion transformer with two text encoders (CLIP-L, T5-XXL) and a dedicated AutoEncoder instead of a VAE (diffusers, kohya). This guide covers the flux lora training parameters that matter across kohya-ss, SimpleTuner, and ai-toolkit.
TL;DR
- Start with rank 16, alpha 16, lr 1e-4, AdamW8bit, bf16 — the ai-toolkit Flux defaults; avoid ranks 64–128 on the 12B model.
- Drop SD-era habits.
clip_skip,min_snr_gamma, andnoise_offsetare not Flux-native kohya parameters (kohya Flux docs). - Budget VRAM. Flux needs ~50 GB system RAM to quantise at startup and ~9–30 GB VRAM by quantisation (SimpleTuner); use
--blocks_to_swap,--cache_text_encoder_outputs, and--gradient_checkpointing.
Is Flux a UNet or a transformer?
Flux is a diffusion transformer, not a UNet (diffusers, kohya). SD parameter names like "unet learning rate" and clip_skip do not map onto Flux. As a flow-matching model, Flux uses --timestep_sampling (recommended flux_shift), --model_prediction_type (recommended raw), and --guidance_scale (1.0 for dev training; 3.5 is for inference) — per the kohya Flux guide. ai-toolkit mirrors this with noise_scheduler: "flowmatch" (config).
How many images do you need for a Flux LoRA?
Practitioner guides suggest 10–50 images for Flux (20–30 for styles, 10–20 for characters), but those figures are community-reported; no trainer docs prescribe a per-type count. The only documented floor is structural: the bare minimum dataset size is train_batch_size * gradient_accumulation_steps as well as more than vae_batch_size. Below that, the run aborts with "no images detected in dataset."
Image quality matters more for Flux than for SD. SimpleTuner warns that Flux "will absorb the artifacts in your images _first_, and then learn the concept/subject" — watermarks and compression artifacts corrupt the result faster than on a smaller model.
Dataset preparation and aspect bucketing
Aspect-ratio bucketing groups images by resolution so the trainer can batch same-shaped images. In kohya the resolution step defaults to 64 px (bucket_reso_steps = 64), and max_bucket_reso/min_bucket_reso must be divisible by it (kohya config docs); SDXL requires multiples of 32 (advanced docs). Crop style is configurable (center/random in SimpleTuner, random_crop in kohya) — "center crop by default" is one option, not a rule.
You do not always need to pre-crop. ai-toolkit states "You do not need to crop/resize your images" — it downscales and buckets automatically. Flux is 1024px-native, and ai-toolkit's example trains across resolution: [512, 768, 1024] ("flux enjoys multiple resolutions," config). kohya supports the same via multiple [[datasets]] blocks (Flux docs §6.7).
Captioning for Flux LoRAs
Caption files are .txt siblings of each image. ai-toolkit supports a [trigger] token replaced by the config's trigger_word, and ships caption_dropout_rate: 0.05 in its Flux example. kohya exposes shuffle_caption, keep_tokens, and caption_tag_dropout_rate per subset (TOML config).
Caption everything you do not want the LoRA to learn (medium, framing, background), and leave uncaptioned only what the trigger word should bind to. Flux "isn't very diverse" with short, similar prompts, so SimpleTuner recommends longer, descriptive validation prompts. See our captioning guide for diffusion LoRAs for more.
What network dim and alpha should you use for a Flux LoRA?
| Setting | kohya Flux example | ai-toolkit Flux example | Common range | Source |
|---|---|---|---|---|
network_dim / linear (rank) | 16 | 16 | 4–128 | kohya train_network.md, ai-toolkit config |
network_alpha / linear_alpha | 1 | 16 | ≈ half of dim, or equal to dim | kohya train_network.md, ai-toolkit config |
| Learning rate | 1e-4 | 1e-4 | Lower than SD; 1e-3 "roasts", 1e-5 "does nothing" | SimpleTuner FLUX.md |
| Optimiser | AdamW8bit | adamw8bit | AdamW8bit (memory-efficient, widely used) | kohya train_network.md |
| Mixed precision | fp16/bf16 | bf16 | bf16 recommended for Flux | SimpleTuner FLUX.md |
Both knobs exist because of rank decomposition: LoRA injects trainable matrices $A$ and $B$ so the update is $\Delta W = BA$ with rank $r \ll \min(d,k)$, and the LoRA paper scales $\Delta W x$ by $1/r$ to keep the update stable as $r$ grows. Trainers generalise that to alpha (scaling by $\alpha/r$), so kohya's default (alpha=1, dim=16) and ai-toolkit's (alpha=16, dim=16) differ by 16× in effective strength — they are not interchangeable. kohya recommends alpha "about half the value of network_dim."
For a 12B model, keep the rank small. SimpleTuner advises "Try a smaller network first (rank-1, rank-4) … Ranks as large as 64 through 128 might be undesirable on a 12B model." --lora_rank=4 also cuts VRAM use.
What learning rate for Flux LoRA training?
Use 1e-4 as a starting point and stay below the SD range. SimpleTuner reports that on a 12B model "LoRA at 1e-3 might totally roast the thing. LoRA at 1e-5 does nearly nothing." (Why a 12B model prefers lower LRs is undocumented; treat as empirical.) kohya splits the rate with --text_encoder_lr 1e-4 1e-5 when training text encoders; ai-toolkit sets train_text_encoder: false and uses steps: 2000 (500–4000 is a good range).
Does Flux LoRA training use clip_skip, min_snr_gamma, or noise_offset?
No — not as Flux-native kohya parameters. kohya's Flux guide lists --clip_skip under "Incompatible/Deprecated Arguments": "These are Stable Diffusion-specific arguments and are not used in FLUX.1 training." Its Flux-specific list covers --guidance_scale, --timestep_sampling, --sigmoid_scale, --model_prediction_type, and --discrete_flow_shift — neither --min_snr_gamma nor --noise_offset appears.
That omission fits the theory: Min-SNR weights timesteps by signal-to-noise ratio and offset noise fixes a DDPM mean-value bias — both are Gaussian-noise-DDPM techniques, not flow-matching. Flux loss weighting uses --weighting_scheme, --logit_mean, --logit_std, and --mode_scale instead. Whether the inherited flags affect a Flux run is undocumented; treat community-reported effects with skepticism. See our SDXL LoRA training settings guide.
How much VRAM do I need to train a Flux LoRA?
Flux is memory-hungry on two fronts, and the ceiling is your card — see our VRAM requirements by model for what fits on 8, 12, 16 and 24GB. SimpleTuner notes "quantising the model at startup requires about 50GB of system memory," and diffusers concurs it "requires ~50GB of RAM/VRAM to load all the modeling components." GPU VRAM for a rank-16 LoRA scales with quantisation:
| Quantisation | Approx. VRAM | Source |
|---|---|---|
| None (bf16/fp16 base) | ~30 GB | SimpleTuner FLUX.md |
| int8 + bf16 | ~18 GB | SimpleTuner FLUX.md |
| int4 + bf16 | ~13 GB | SimpleTuner FLUX.md |
| NF4 / int2 + bf16 | ~9 GB | SimpleTuner FLUX.md |
SimpleTuner calls "the absolute minimum … a single 3080 10G" and "a realistic minimum … a single 3090 or V100." kohya's per-card table maps 24 GB (batch 2), 16 GB (batch 1 + --blocks_to_swap), 12 GB (--blocks_to_swap 16 + 8-bit AdamW), 10 GB (--blocks_to_swap 22 + fp8 T5-XXL), and 8 GB (--blocks_to_swap 28 + fp8 T5-XXL). An RTX 3060 12 GB at 512 is community-reported as workable.
VRAM-reduction techniques that work for Flux
--blocks_to_swapswaps transformer blocks CPU↔GPU (up to 35 for Flux); cannot combine with--cpu_offload_checkpointing(kohya).--cache_text_encoder_outputs/--cache_latentspre-compute encoder/AE outputs; caching text-encoder outputs disables text-encoder LoRA, so add--network_train_unet_only(kohya SDXL docs).--gradient_checkpointing— SimpleTuner: set it true "in practically every situation on every device."--fp8_baseloads Flux, CLIP-L, and T5-XXL in FP8; "training results may vary" (kohya).- Group offloading (diffusers v0.33+, SimpleTuner) cuts VRAM but is mutually exclusive with
--enable_model_cpu_offload(SimpleTuner). gradient_accumulation_stepssimulates a larger batch without extra VRAM (effective batch =train_batch_size × grad_accum, kohya) at linear runtime cost (SimpleTuner).
Batch size, repeats, and steps
Keep train_batch_size at 1 for small datasets (SimpleTuner). num_repeats multiplies effective dataset size (20 images × 5 repeats behaves like 100) and is the documented fix when a dataset is too small to start. Bucketing constrains batching: images of different dimensions cannot share a batch, so odd bucket counts blunt the benefit of larger batches. For gradient accumulation on Flux, SimpleTuner revised earlier guidance: "Previous guidance was to avoid these with bf16 training since they would degrade the model. Further testing showed this is not necessarily the case for Flux." Its lowest-VRAM recipe (≈9 GB) uses NF4-bnb, Lion 8-bit paged, 512 px, batch 1, zero accumulation.
Common errors and fixes
| Symptom | Cause | Fix |
|---|---|---|
| "no images detected in dataset" | Dataset smaller than batch × grad_accum or vae_batch | Increase repeats, or lower batch/accum (SimpleTuner) |
| SIGKILL after text encoders unload | Insufficient system RAM (~50 GB) to quantise Flux | Use --base_model_precision=bf16 or --quantize_via=accelerator; add system memory (SimpleTuner) |
| OOM during startup on ≤16 GB cards | Quantising on GPU exhausts VRAM | Add --quantize_via=cpu (SimpleTuner) |
| Text-encoder LoRA not training | --cache_text_encoder_outputs disables it | Remove caching or add --network_train_unet_only (kohya SDXL docs) |
| Square grid artifacts in samples | Overtraining, too-high LR, weird aspect ratios | Lower LR, curate data, avoid extreme aspect ratios (SimpleTuner) |
| NF4 model collapse | Lion optimiser + NF4 instability | Switch to AdamW variants; add --max_grad_norm=0.01 (SimpleTuner) |
voluptuous.error.MultipleInvalid: required key not provided | Missing or misspelled TOML option | Add the option the error path names (kohya config docs) |
FAQ
What network dim and alpha should I use for a Flux LoRA? Start at rank 16 with alpha 16 (ai-toolkit default) or alpha 1 (kohya default). The two are not interchangeable: alpha scales the update by α/r, so ai-toolkit's 16/16 and kohya's 1/16 differ by 16× in effective strength (kohya, ai-toolkit). For a 12B model, prefer small ranks — SimpleTuner suggests rank 1 or 4 first, and warns ranks 64–128 "might be undesirable."
Does Flux LoRA training use clip_skip? No. kohya's Flux guide lists --clip_skip as incompatible: "These are Stable Diffusion-specific arguments and are not used in FLUX.1 training." Flux uses CLIP-L and T5-XXL, and its training script does not consume that flag.
Is Flux a UNet or a transformer? Flux is a diffusion transformer, not a UNet. diffusers calls it "based on diffusion transformers," and kohya notes its "Transformer-based architecture." The trainable component is the transformer (MMDiT-style blocks), so "unet learning rate" terminology from SD does not apply.
How much VRAM do I need to train a Flux LoRA? Plan for ~50 GB of system RAM to quantise at startup, plus 9–30 GB of GPU VRAM by quantisation (SimpleTuner). Absolute minimum is a 10 GB 3080; realistic minimum a 3090 or V100. kohya maps 24/16/12/10/8 GB cards to specific --blocks_to_swap values and fp8 T5-XXL.
What learning rate for Flux LoRA training? Use 1e-4 as a baseline and stay below SD-era values. SimpleTuner reports that on the 12B model "LoRA at 1e-3 might totally roast the thing. LoRA at 1e-5 does nearly nothing." AdamW8bit is the common optimiser; bf16 is the recommended mixed precision.
Do min_snr_gamma or noise_offset work for Flux? They are not in kohya's Flux-specific parameter list. Both are DDPM/SNR techniques — Min-SNR weights timesteps by SNR, offset noise fixes a DDPM mean-value bias. Flux is flow-matching, so use --weighting_scheme and --timestep_sampling instead; their effect when passed to Flux is undocumented.
Can I train a Flux LoRA on 12 GB VRAM? Yes, with trade-offs. kohya's 12 GB recipe uses --blocks_to_swap 16 + 8-bit AdamW; SimpleTuner's lowest config (NF4, 512 px, batch 1) targets ~9 GB. An RTX 3060 12 GB at 512 px is community-reported as workable. Expect slower training and no batch headroom.
Do I need to crop my images for Flux LoRA training? Not always. ai-toolkit auto-resizes and buckets: "You do not need to crop/resize your images." kohya's bucket step defaults to 64 px, with crop_style set to center or random. Manual cropping to exact bucket dimensions is optional, useful only to avoid auto-crop surprises.
What is flow matching in Flux training? Flow matching is Flux's training objective, used instead of Gaussian-noise denoising. In ai-toolkit it appears as noise_scheduler: "flowmatch"; in kohya as --timestep_sampling flux_shift and --model_prediction_type raw. It changes which loss-weighting and timestep parameters apply.
Sources
- kohya-ss/sd-scripts — Flux LoRA training guide
- kohya-ss/sd-scripts — train_network.py guide
- kohya-ss/sd-scripts — dataset config guide
- kohya-ss/sd-scripts — advanced SDXL training options
- kohya-ss/sd-scripts — SDXL training guide
- SimpleTuner — Flux dev/schnell quickstart
- SimpleTuner — README
- ostris/ai-toolkit — README
- ostris/ai-toolkit — Flux dev example config
- ostris/ai-toolkit — Flux schnell example config
- Hugging Face diffusers — Flux docs
- LoRA: Low-Rank Adaptation of Large Language Models (arXiv 2106.09685)
- Efficient Diffusion Training via Min-SNR Weighting Strategy (arXiv 2303.09556)
- Diffusion with Offset Noise — Cross Labs
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "Train a FLUX.1 LoRA with the parameters that matter",
"description": "Configure dataset, captioning, network dim/alpha, learning rate, and VRAM settings for a FLUX.1 LoRA.",
"step": [
{
"@type": "HowToSection",
"name": "Configure the LoRA network",
"itemListElement": [
{ "@type": "HowToStep", "position": 1, "name": "Set rank and alpha", "text": "Start with rank 16 and alpha 16 (ai-toolkit) or alpha 1 (kohya). For the 12B Flux model, prefer small ranks; SimpleTuner suggests trying rank 1 or 4 first." },
{ "@type": "HowToStep", "position": 2, "name": "Set the learning rate", "text": "Use 1e-4 as a baseline. On the 12B model, 1e-3 may destabilise training and 1e-5 may have little effect, per SimpleTuner." },
{ "@type": "HowToStep", "position": 3, "name": "Choose the optimizer and precision", "text": "Use AdamW8bit and bf16 mixed precision. Enable gradient checkpointing on every device." }
]
},
{
"@type": "HowToSection",
"name": "Manage VRAM",
"itemListElement": [
{ "@type": "HowToStep", "position": 4