Skip to content

Flux 1 LoRA training

Train a Flux.1 LoRA on your own image dataset using AI Toolkit. The output LoRA is usable directly in Flux 1 image generation (sdcpp or Comfy paths).

modelVariantBase modelInference characteristics
dev (default)black-forest-labs/FLUX.1-devHigher fidelity, ~20–28 sampler steps. Good default for most LoRAs.
schnellblack-forest-labs/FLUX.1-schnellFaster inference, 4 sampler steps, no CFG. Use when you specifically want a Schnell-targeted LoRA.

The base checkpoint is fixed by modelVariant — there's no model field to override. To train on a non-BFL Flux.1 finetune, use the SDXL & SD1 or other-image ecosystems instead.

Long-running step

Flux 1 training is the most expensive AI Toolkit image ecosystem (2000 Buzz for the default run) and a typical 2000-step run on a 10-image dataset takes several minutes. Always use wait=0 and follow up via polling or a webhook — see Results & webhooks.

The request shape

json
{
  "$type": "training",
  "input": {
    "engine":       "ai-toolkit",
    "ecosystem":    "flux1",
    "modelVariant": "dev"        // dev | schnell
  }
}

Prerequisites

  • A Civitai orchestration token (Quick start → Prerequisites)
  • A training-data zip uploaded to a reachable URL (signed R2 URL, Civitai R2 AIR, or any HTTPS URL)
  • An accurate count of images in the zip

Flux 1 dev (default)

Trains on top of FLUX.1-dev and produces a LoRA usable with any Flux 1 dev workflow.

http
POST https://orchestration.civitai.com/v2/consumer/workflows?wait=0
Authorization: Bearer <your-token>
Content-Type: application/json

{
  "tags": ["training"],
  "steps": [{
    "$type": "training",
    "priority": "normal",
    "retries": 2,
    "input": {
      "engine": "ai-toolkit",
      "ecosystem": "flux1",
      "modelVariant": "dev",
      "steps": 2000,
      "resolution": 1024,
      "lr": 0.0001,
      "trainTextEncoder": false,
      "lrScheduler": "cosine",
      "optimizerType": "adamw8bit",
      "networkDim": 16,
      "networkAlpha": 16,
      "trainingData": {
        "type": "zip",
        "sourceUrl": "urn:air:other:other:civitai-r2:civitai-delivery-worker-prod@training-images/6/2657604TrainingData.EYBd.zip",
        "count": 10
      },
      "samples": {
        "prompts": ["a photo of TOK", "TOK in a garden", "TOK portrait"]
      }
    }
  }]
}
POST/v2/consumer/workflows
Set your Civitai API token via the Token button in the navbar to enable Try It.
Request body — edit to customize (e.g. swap the image URL or prompt)
Valid JSON

Flux 1 schnell

Trains on top of FLUX.1-schnell. Inference uses 4 steps and cfgScale: 0 — the output LoRA is meant to be used in those conditions.

http
POST https://orchestration.civitai.com/v2/consumer/workflows?wait=0
Authorization: Bearer <your-token>
Content-Type: application/json

{
  "tags": ["training"],
  "steps": [{
    "$type": "training",
    "input": {
      "engine": "ai-toolkit",
      "ecosystem": "flux1",
      "modelVariant": "schnell",
      "steps": 2000,
      "lr": 0.0001,
      "trainTextEncoder": false,
      "networkDim": 16,
      "networkAlpha": 16,
      "trainingData": {
        "type": "zip",
        "sourceUrl": "urn:air:other:other:civitai-r2:civitai-delivery-worker-prod@training-images/6/2657604TrainingData.EYBd.zip",
        "count": 10
      },
      "samples": { "prompts": ["a photo of TOK", "TOK in a garden"] }
    }
  }]
}
POST/v2/consumer/workflows
Set your Civitai API token via the Token button in the navbar to enable Try It.
Request body — edit to customize (e.g. swap the image URL or prompt)
Valid JSON

Common parameters

Shared by both Flux 1 variants. Defaults shown are after ApplyDefaults.

FieldRequiredDefaultNotes
engineAlways ai-toolkit.
ecosystemAlways flux1 for this page.
modelVariantdev or schnell. Determines the base checkpoint.
steps2000110000. Total training steps. Primary driver of training length and pricing.
epochs10120. Number of saved checkpoints delivered, each separately downloadable. Each adds 20 Buzz of storage.
batchSize1Fixed at 1 for this ecosystem.
continueFrom(none)A previously-trained urn:air:flux1:lora:... AIR to resume from (see Continue training). Must be a Flux 1 LoRA.
lr0.0001UNet learning rate. Flux 1 is sensitive to high LRs — keep ≤ 0.0005.
trainTextEncoderfalseFlux 1 does not benefit much from text-encoder training. Leave off.
lrSchedulercosineconstant, constant_with_warmup, cosine, linear, step.
optimizerTypeadamw8bitadamw, adamw8bit, adam8bit, lion, lion8bit, adafactor, adagrad, prodigy, prodigy8bit, automagic.
networkDim161256. Flux 1's lower default reflects how compactly Flux LoRAs encode style/character vs. SD-family.
networkAlphamatches networkDim1256.
noiseOffset001.
flipAugmentationfalseRandom horizontal flips.
shuffleTokens / keepTokensfalse / 0Caption-tag shuffling.
triggerWord(none)Activation token. Recommended for character / style LoRAs.
trainingData.{type, sourceUrl, count}Always type: "zip".
samples.prompts[][]Preview prompts rendered at each saved checkpoint using the trained LoRA at strength 1.0.
samples.negativePrompt(none)
samples.cfgScale(ecosystem default)Overrides the CFG / guidance scale used when rendering the preview samples.
samples.strength1.0Trained-LoRA weight applied in the preview samples.

Continue training / train further

To resume from a Flux 1 LoRA you already trained instead of starting from the BFL base, set continueFrom to that LoRA's AIR. The new run starts from those weights and the new epochs build on top:

json
{
  "$type": "training",
  "input": {
    "engine": "ai-toolkit",
    "ecosystem": "flux1",
    "modelVariant": "dev",
    "continueFrom": "urn:air:flux1:lora:civitai:<id>@<version>",
    "steps": 1000
  }
}

continueFrom must point at a LoRA of the same ecosystem (flux1) as the model being trained — a mismatched ecosystem is rejected.

Reading the result

Same envelope as the other training recipes — see SDXL/SD1 → Reading the result for the full shape. The relevant bit:

json
{
  "output": {
    "moderationStatus": "Approved",
    "epochs": [
      {
        "epochNumber": 1,
        "model": { "id": "blob_...", "url": "https://.../epoch_1.safetensors" },
        "samples": [{ "id": "blob_...", "url": "https://.../sample_0.jpeg" }]
      }
    ]
  }
}

The model blob is your trained LoRA — download it (URLs are signed and expire), or use the blob URL directly with Flux 1 image generation by referencing its AIR in the loras field.

Runtime

Per-step wall time on a 10-image dataset, default settings:

VariantPer-step2000-step full run
dev~0.3–0.7 s10–30 min
schnell~0.3–0.7 s10–30 min

Always use wait=0.

Cost

Training is billed per step plus a flat per-epoch storage surcharge, with a price floor:

price = steps × costPerStep + epochs × 20        (rounded)
costPerStep = 0.9   (dev and schnell)
floor: never less than 80% of the default-configuration price

epochs is the number of saved checkpoints delivered (default 10, range 120); each adds 20 Buzz of storage. The default run is 2000 steps / 10 epochs2000 × 0.9 + 10 × 20 = 1800 + 200 = 2000 Buzz. The floor is 80% of the default price (1600 Buzz).

ConfigurationBuzz
default (steps: 2000, epochs: 10)2000 + samples
steps: 1000, epochs: 101600 + samples (floor)
steps: 2000, epochs: 202200 + samples (+200 for 10 more checkpoints)

Sample-prompt rendering is billed separately at the appropriate Flux 1 generation rate. Run with whatif=true (the Preview cost button on the widgets above) to see the exact pre-flight charge.

Troubleshooting

SymptomLikely causeFix
400 with "modelVariant required"Missing modelVariant fieldSet to "dev" or "schnell".
400 with "steps out of range"steps outside 110000Cap at 10000.
400 with "trainingData.sourceUrl not reachable"Signed URL expiredRegenerate. Prefer Civitai R2 AIRs over signed URLs for long-lived references.
Trained LoRA underbakedToo few steps for dataset, or lr too lowRaise steps to 1500–2500 for character LoRAs; keep lr at 0.00010.0003.
Trained LoRA overfitsToo many steps / too high networkDimLower steps, drop networkDim to 8–12.
Step failed, output moderationStatus: "Rejected"Dataset failed content moderationReplace flagged images.

Civitai Developer Documentation