Skip to content

SDXL & SD1 LoRA training ​

Train a Stable Diffusion LoRA on your own image dataset using AI Toolkit. This page covers the two classic SD ecosystems:

ecosystemOutput LoRA usable withDefault priceNative resolution
sdxlSDXL image generation500 Buzz1024²
sd1SD1 image generation500 Buzz512²

Both are the cheapest training ecosystems on the platform — good first pick when iterating on dataset choice or hyperparameters before stepping up to a more expensive model family. SDXL is the better default for new fine-tunes; SD1 is mostly useful when you specifically need a SD 1.5 LoRA (e.g. to deploy onto an existing SD 1.5 product).

The request shape, training data (zip or uploaded blobs), common parameters, continuing a run and live progress are shared by every ecosystem — see the LoRA training overview. This page covers the SD-family-specific fields (model, minSnrGamma, triggerWord, default text-encoder behavior). Submit with wait=0; the widgets below preview cost only.

The request shape ​

json
{
  "$type": "training",
  "input": {
    "engine":    "ai-toolkit",
    "ecosystem": "sdxl"          // sdxl | sd1
  }
}

SDXL ​

Stable Diffusion XL trains at 1024² and produces a LoRA usable with any SDXL checkpoint. The base checkpoint defaults to urn:air:sdxl:checkpoint:civitai:101055@128078 (Juggernaut XL); override model to train on top of a different SDXL checkpoint.

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": "sdxl",
      "model": "urn:air:sdxl:checkpoint:civitai:101055@128078",
      "steps": 2000,
      "lr": 0.0005,
      "textEncoderLr": 5e-5,
      "trainTextEncoder": true,
      "lrScheduler": "cosine",
      "optimizerType": "adafactor",
      "networkDim": 32,
      "networkAlpha": 32,
      "noiseOffset": 0.1,
      "minSnrGamma": 5,
      "triggerWord": "cat",
      "trainingData": {
        "type": "zip",
        "sourceUrl": "urn:air:other:other:huggingface:datasets/Civitai/orchestration-samples@e86d025874700507615ae8ef74937c319ea41dfe/sample-training-dataset.zip",
        "count": 15
      },
      "samples": {
        "prompts": [
          "catz no humans, cat, whiskers, animal focus, looking at viewer, animal, solo, yellow eyes",
          "catz no humans, candle, pokemon (creature), blurry, animal focus, solo, food, bird, standing",
          "catz no humans, food, noodles, bowl, cat, green eyes, tongue, food focus, ramen, chopsticks"
        ]
      }
    }
  }]
}
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

SDXL-specific fields:

FieldDefaultRange / valuesNotes
modelurn:air:sdxl:checkpoint:civitai:101055@128078Any SDXL checkpoint AIRThe base checkpoint your LoRA is trained on top of.
minSnrGamma50–20Min-SNR-γ stabilization. 5 is a good default; lower values can speed up convergence on simple subjects.
triggerWord(none)stringOptional prompt token that activates the trained LoRA. Recommended for character / style LoRAs.
trainTextEncodertrueboolSDXL benefits noticeably from text-encoder training. Disable to halve memory cost at the price of prompt-following quality.
textEncoderLr5e-50–1Only used when trainTextEncoder: true.
optimizerTypeadafactorsee enumadafactor is the SDXL house default; adamw8bit works too if you have memory headroom.
noiseOffset0.10–1
lr0.00010–10.0005 is typical for character/style LoRAs on SDXL.
batchSize1up to 4Same maximum for SDXL and SD1.
continueFrom(none)urn:air:sdxl:lora:...Must be an SDXL LoRA (an SD1 LoRA for sd1).

SD1 ​

Stable Diffusion 1.5 trains at 512² and produces a LoRA usable with any SD1.5 checkpoint. Base checkpoint defaults to urn:air:sd1:checkpoint:civitai:127227@139180. Same shape as SDXL with two differences: optimizerType defaults to adamw8bit (not adafactor), and noiseOffset defaults to 0 (not 0.1).

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": "sd1",
      "model": "urn:air:sd1:checkpoint:civitai:127227@139180",
      "steps": 4000,
      "lr": 0.0005,
      "textEncoderLr": 5e-5,
      "trainTextEncoder": true,
      "lrScheduler": "cosine",
      "optimizerType": "adamw8bit",
      "networkDim": 32,
      "networkAlpha": 16,
      "noiseOffset": 0.1,
      "minSnrGamma": 5,
      "trainingData": {
        "type": "zip",
        "sourceUrl": "urn:air:other:other:huggingface:datasets/Civitai/orchestration-samples@e86d025874700507615ae8ef74937c319ea41dfe/sample-training-dataset.zip",
        "count": 15
      },
      "samples": {
        "prompts": [
          "no humans, cat, whiskers, animal focus, looking at viewer, animal, solo, yellow eyes",
          "no humans, food, tiger, cake, animal focus, food focus, whiskers, black background",
          "no humans, fruit, food, bug, black background, wings, food focus, orange (fruit), antennae"
        ]
      }
    }
  }]
}
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

SD1-specific fields are a subset of the SDXL list — same model / minSnrGamma / triggerWord / trainTextEncoder / textEncoderLr, with these defaults:

FieldSD1 defaultSDXL default
optimizerTypeadamw8bitadafactor
noiseOffset00.1

Reading the result ​

The standard training output: an epochs[] array with each saved checkpoint's SDXL / SD1 LoRA .safetensors blob and sample images, plus the dataset's moderationStatus. Use the LoRA in SDXL or SD1 image generation via loras: { "<lora-air>": 1.0 }.

Runtime ​

Training is highly variable and depends on steps.

EcosystemPer-step wall time (15 imgs, default settings)Typical full run
sdxl~0.3–0.5 s5–15 min for 2000 steps
sd1~0.1–0.2 s3–10 min for 4000 steps (SD1 is much faster per step)

Cost ​

The training cost formula with SDXL / SD1 rates:

price = steps × costPerStep + epochs × 10        (rounded)
costPerStep = 0.20   (sdxl and sd1)
floor: never less than 80% of the default-configuration price

Each epoch adds 10 Buzz of storage. The SD1 example above sends steps: 4000 with no epochs, so it gets 20 epochs: 4000 × 0.20 + 20 × 10 = 1000 Buzz. The default run is 2000 steps / 10 epochs, which lands the price on the familiar number:

2000 × 0.20 + 10 × 10 = 400 + 100 = 500 Buzz

The floor is 80% of the default price (400 Buzz for both SDXL and SD1). Sample-prompt rendering is billed separately at standard SDXL / SD1 image-generation rates. Preview the exact charge with whatif=true (Payments (Buzz)).

ConfigurationBuzz
SDXL / SD1, default (steps: 2000, epochs: 10)500 + samples
SDXL / SD1, steps: 1000, epochs: 10400 + samples (floor)
SDXL / SD1, steps: 2000, epochs: 20600 + samples

Troubleshooting ​

steps out of range, an unresolvable sourceUrl, a count mismatch and a rejected dataset are covered in the overview's troubleshooting.

SymptomLikely causeFix
400 with "model not found"model URN points at a checkpoint that isn't the right ecosystem (e.g. an SD1 model on ecosystem: "sdxl")Use a urn:air:sdxl:checkpoint:... AIR for SDXL; urn:air:sd1:checkpoint:... for SD1.
Trained LoRA looks under-trainedToo few steps for the datasetRaise steps; or increase lr.
Trained LoRA overfits / memorizesToo many steps, dim too high, or alpha = dim with high lrLower steps, drop networkDim to 16–24, or set networkAlpha to half of networkDim.

Civitai Developer Documentation