---
title: "Generate with ERNIE-Image-Turbo"
method: POST
path: "/v1/ernie/generate"
tags: ["generate"]
---

# Generate with ERNIE-Image-Turbo

`POST /v1/ernie/generate`

Generates images synchronously using the ERNIE-Image-Turbo model. Width
and height must each be a positive multiple of 16 and the total area
must not exceed 1,075,200 pixels (896×1200); the server validates these
against the model's resolution constraints.

Images links are available for a limited period of time; if you would like to keep the image, you must download it.

## Request body

- GenerateImageRequestErnie — Request body for the ERNIE-Image-Turbo generate endpoint. The base model is pinned server-side; supply `custom_model_uri` to layer a registered ERNIE LoRA finetune on the base. Width and height must each be a positive multiple of 16; the total area must not exceed 1,075,200 pixels (896×1200). When `width` and `height` are omitted, the server uses the model's default 1024×1024.
  - `prompt` string, required — A natural-language prompt for image generation.
  - `system_prompt` string, nullable — An optional system prompt applied alongside the prompt — use it for standing instructions such as style constraints or "do not render text". When omitted, no system prompt is applied. If you trained a LoRA with a system prompt, supply the same one here for best results.
  - `width` integer, nullable — Output width in pixels; must be a positive multiple of 16.
  - `height` integer, nullable — Output height in pixels; must be a positive multiple of 16.
  - `num_inference_steps` integer, nullable — Optional diffusion step count. When omitted, the server uses the model's default. Higher values trade latency for quality.
  - `seed` integer, nullable — Random seed for reproducibility.
  - `num_images` integer, nullable — Number of images to generate.
  - `custom_model_uri` string, nullable — A custom model URI in the format model/<model_name>/version/<version_name>. When provided, the URI must resolve to a registered fine-tune of the ERNIE base model; the fine-tune's LoRA checkpoint is layered on the base. When omitted, the ERNIE base is used with no LoRA.

## Response `200`

Image(s) generated successfully.

- ImageGenerationResponse — The response for self-hosted open-source model generation endpoints. Uses a free-form resolution string (not a grid enum) because these models accept arbitrary dimensions.
  - `created` string, date-time, required — The time the request was created.
  - `data` ImageGenerationObject[], required — A list of ImageObjects that contain the generated image(s).
    - `object_type` 'image.generation' — Discriminator marking this entry as a generated image in the polling endpoint's mixed data array.
    - `url` string, uri, nullable — The direct link to the image generated.
    - `prompt` string, required — The prompt used for the generation. This may be different from the original prompt.
    - `resolution` string, required — The resolution of the generated image, formatted as "{width}x{height}".
    - `is_image_safe` boolean, required — Whether this image passes safety checks. If false, the url field will be empty.
    - `seed` integer, required — Random seed. Set for reproducible generation.

## Other responses

- `400` — Invalid input provided.
- `401` — Not authorized.
- `422` — Prompt failed the safety check.
- `429` — Too many requests.

---

[API](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0.md) · [All operations](https://skmtc.net/ideogram/apis/ideogram-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ideogram/ideogram-openapi-3-0/versions/bcc2d45be91e/schema)
