latestOpenAPI 3.0.22026-08-19125272497.5 KB

73707bc35f34

images-generate

Generate images with Ideogram 4.0 from a text or structured prompt

Generate one or more images from a prompt with Ideogram 4.0. The prompt accepts either natural language or a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. A structured JSON prompt is consumed by the model directly and skips magic prompt.

magic_prompt controls how a natural-language prompt is prepared: AUTO/ON rewrite and expand the prompt before generation, while OFF keeps your wording and only converts the prompt into the structured format the model consumes.

When resolution is omitted, the server picks an aspect ratio automatically based on the prompt.

By default the request blocks until the images are ready and returns them in data. Set async to true to return immediately after the request is accepted, then poll for completion and results with GET /v1/generations/{generation_id} using the returned generation_id.

post/v2/images/generate/ideogram-v4

Request body

promptstring required

The prompt to generate images from. Accepts either natural language or a structured Ideogram 4.0 JSON prompt; the server detects which was supplied. A structured JSON prompt is consumed by the model directly and skips magic prompt.

magic_prompt'AUTO' | 'ON' | 'OFF'

Determine if MagicPrompt should be used in generating the request or not.

seedinteger

Random seed. Set for reproducible generation.

num_imagesinteger

The number of images to generate.

resolution'2048x2048' | '1440x2880' | '2880x1440' | '1664x2496' | '2496x1664' | '1792x2240' | '2240x1792' | '1440x2560' | '2560x1440' | '1600x2560' | '2560x1600' | '1728x2304' | '2304x1728' | '1296x3168' | '3168x1296' | '1152x2944' | '2944x1152' | '1248x3328' | '3328x1248' | '1280x3072' | '3072x1280' | '1024x3072' | '3072x1024' | '1024x1024' | '896x1120' | '1120x896' | '864x1152' | '1152x864' | '832x1248' | '1248x832' | '800x1280' | '1280x800' | '720x1280' | '1280x720' | '720x1440' | '1440x720' | '512x1536' | '1536x512'

The 1K and 2K resolutions supported for Ideogram 4.0 image generation.

rendering_speed'TURBO' | 'DEFAULT' | 'QUALITY'

The rendering speed to use.

enable_copyright_detectionboolean nullable

Optional. Opt this request into post-generation copyright detection. Adds detection latency; flagged images come back with is_image_safe: false.

asyncboolean

When false (the default), the request blocks until the images are ready and returns them in data. When true, the request returns as soon as it is accepted; poll for completion and results with GET /v1/generations/{generation_id} using the returned generation_id.

Example request

{
  "magic_prompt": "",
  "async": false,
  "seed": 12345,
  "rendering_speed": "DEFAULT",
  "enable_copyright_detection": true,
  "prompt": "prompt",
  "resolution": "",
  "num_images": 1
}

Response

The generated images (synchronous requests), or an acknowledgement to poll with GET /v1/generations/{generation_id} (async requests).

generation_idstring required

URL-safe base64 ID of the accepted generation. Accepted by the GET /v1/generations/{generation_id} polling endpoint.

seedinteger required

Random seed. Set for reproducible generation.

Example response

{
  "data": [
    {
      "seed": 12345,
      "prompt": "prompt",
      "resolution": "1024x1024",
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    },
    {
      "seed": 12345,
      "prompt": "prompt",
      "resolution": "1024x1024",
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    }
  ],
  "seed": 12345,
  "generation_id": "generation_id"
}