Skip to content

ERNIE image generation

Baidu's ERNIE Image is a distillation-friendly text-to-image family hosted on Civitai's Comfy workers. Single engine path, one operation (createImage — no img2img, variant, or edit support), two model variants that differ only in speed vs. quality:

  • engine: "comfy", ecosystem: "ernie"
  • Only createImage — ERNIE doesn't expose createVariant or editImage. Use Flux 2 Klein or Qwen if you need img2img or prompt-driven editing.
  • Built-in diffuser, VAE, and text encoder — no model URN to pick. The only model field is the variant selector (ernie or turbo).
  • LoRA support (ERNIE-tagged LoRAs only).

Variants

modelSteps (default)cfgScale (default)Best for
ernie204Default — full-quality output, standard sampling
turbo81Distilled for speed — 3–4× faster and ~⅓ the Buzz per image; use for drafts, batches, and iteration

Leave cfgScale: 1 on turbo — it's a distilled model and doesn't respond to classifier-free guidance the way the standard variant does.

Prerequisites

  • A Civitai orchestration token (Quick start → Prerequisites)
  • No checkpoint URN required — both variants ship with built-in diffuser / VAE / text encoder

Standard (model: "ernie")

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

{
  "steps": [{
    "$type": "imageGen",
    "input": {
      "engine": "comfy",
      "ecosystem": "ernie",
      "model": "ernie",
      "operation": "createImage",
      "prompt": "A red panda wearing a yellow rain jacket, cinematic soft light, highly detailed",
      "width": 1024,
      "height": 1024,
      "steps": 20,
      "cfgScale": 4,
      "sampler": "euler",
      "scheduler": "simple",
      "quantity": 1
    }
  }]
}
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

Parameters

FieldDefaultRangeNotes
prompt— ✅≤ 10 000 charsNatural-language descriptions work well; ERNIE handles complex scenes better than tag-soup.
negativePrompt(none)≤ 10 000 charsOptional. Shorter is usually better — ERNIE's defaults are already clean.
width / height1024642048, divisible by 16Trained around 1024². Well-behaved near ~1 megapixel total.
steps201150Diminishing returns past ~25.
cfgScale403035 is the sweet spot.
samplereulerenumComfySampler. euler is what the model was tuned against.
schedulersimpleenumComfyScheduler.
loras{}{ airUrn: strength }Stack multiple. Only urn:air:ernie:lora:... LoRAs work here.
quantity1112Number of images per call.
seedrandomint64Pin for reproducibility.

Portrait aspect ratio

json
{
  "steps": [{
    "$type": "imageGen",
    "input": {
      "engine": "comfy",
      "ecosystem": "ernie",
      "model": "ernie",
      "operation": "createImage",
      "prompt": "Portrait of a woman with flowing hair standing in a blooming cherry blossom field, golden hour lighting",
      "negativePrompt": "worst quality, blurry, low resolution",
      "width": 832,
      "height": 1216,
      "steps": 20,
      "cfgScale": 4,
      "sampler": "euler",
      "scheduler": "simple",
      "seed": 42
    }
  }]
}
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

Turbo (model: "turbo")

Distilled variant — same input surface as standard, just lower defaults for steps and cfgScale. Use this as the default when you're iterating on prompts or generating batches; fall back to ernie for hero shots.

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

{
  "steps": [{
    "$type": "imageGen",
    "input": {
      "engine": "comfy",
      "ecosystem": "ernie",
      "model": "turbo",
      "operation": "createImage",
      "prompt": "A red panda wearing a yellow rain jacket, cinematic soft light, highly detailed",
      "width": 1024,
      "height": 1024,
      "steps": 8,
      "cfgScale": 1,
      "sampler": "euler",
      "scheduler": "simple",
      "quantity": 1
    }
  }]
}
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

Turbo-specific tuning:

FieldDefaultNotes
steps8Stay in 612. Pushing past ~16 wastes Buzz without improving output on the distilled model.
cfgScale1Distilled — leave at 1. Raising it usually over-saturates / burns the output.

Everything else (prompt, negativePrompt, dimensions, sampler, scheduler, seed, quantity, loras) matches the standard variant.

Reading the result

ERNIE emits the standard imageGen output — an images[] array, one entry per quantity:

json
{
  "status": "succeeded",
  "steps": [{
    "$type": "imageGen",
    "name": "$0",
    "status": "succeeded",
    "output": {
      "images": [
        {
          "id": "aa6e7228-68cd-4d15-b4d7-5005b2bfbac6-0.jpg",
          "width": 1024,
          "height": 1024,
          "url": "https://orchestration.civitai.com/v2/consumer/blobs/…?sig=…",
          "urlExpiresAt": "2027-04-15T17:18:54.3195353Z",
          "previewUrl": "https://orchestration.civitai.com/v2/consumer/blobs/…?sig=…",
          "previewUrlExpiresAt": "2027-04-15T17:18:54.3196735Z",
          "available": true,
          "nsfwLevel": "pg13"
        }
      ],
      "errors": []
    }
  }]
}

url and previewUrl are signed and expire — refetch the workflow or call GetBlob for a fresh URL. The nsfwLevel field carries the moderation classification applied to the output.

Cost

Billed in Buzz on the workflow's transactions. Use whatif=true for an exact preview; see Payments (Buzz) for currency selection.

Per-pixel + per-step scaling against 1024² and the variant's default step count:

Standard (ComfyErnieStandardCreateImageGenInput.CalculateCost):

total = 20 × (width × height / 1024²) × (steps / 20) × quantity

Turbo (ComfyErnieTurboCreateImageGenInput.CalculateCost):

total = 8 × (width × height / 1024²) × (steps / 8) × quantity
ShapeStandard (Buzz)Turbo (Buzz)
1024² / default steps / quantity: 1 (defaults)208
832×1216 / default steps / quantity: 1~20~8
1024² / default steps / quantity: 4~80~32
1024² / steps: 40 (standard) / steps: 16 (turbo)~40~16

Standard pricing is ~2.5× turbo at defaults — reach for turbo when iterating on prompts.

Runtime

Claim duration (job.startedAtjob.completedAt) measured against orchestration-next with quantity: 1:

VariantShapeClaim duration
ernie (standard)1024² / 20 steps~29 s
ernie (standard)832×1216 / 20 steps~27 s
turbo1024² / 8 steps~13 s

wait=60 covers single-image calls comfortably. For quantity > 1, larger dimensions, or high steps counts, compute + queue wait typically runs past the 60 s long-poll ceiling — submit with wait=60 and re-issue GET /v2/consumer/workflows/{id}?wait=60 on a loop until the response is terminal (see Submitting work → Waiting for results), or register a webhook.

Troubleshooting

SymptomLikely causeFix
400 with "No derived type found for discriminator value 'ernie'" on ecosystemERNIE not yet rolled out to the environment you're hittingConfirm the target orchestrator lists ernie in /openapi/v2-consumers.jsonComfyImageGenInput ecosystem enum. Retry after rollout.
400 with "operation must be createImage"Passed editImage or createVariantERNIE only supports createImage. Use Qwen or Flux 2 Klein for img2img / edit.
400 on modelSent a full AIR URN or a value other than ernie / turboThe model field is a variant selector, not a checkpoint URN. Only "ernie" and "turbo" are valid.
400 on width / heightValue not divisible by 16, or outside 642048Round to a valid multiple of 16 inside that range.
Turbo output looks over-saturated / blown outcfgScale > 1 on the distilled modelSet cfgScale: 1 for turbo. Raise steps instead if you want more fidelity.
Standard output ignores the promptcfgScale too lowBump toward 46. cfgScale: 1 on standard barely steers the model.
LoRA silently has no effectWrong AIR URN, or ecosystem mismatchOnly urn:air:ernie:lora:… LoRAs work here. Verify the URN on the LoRA's Civitai page.
Request timed out (wait expired)Large quantity, atypical dimensions, or high stepsResubmit and resume with a GET …?wait=60 loop, or register a webhook.
Step failed, reason = "blocked"Prompt hit content moderationDon't retry the same input — see Errors & retries → Step-level failures.

Civitai Developer Documentation