latestOpenAPI 3.0.22026-08-21134292561.4 KB

898026c78d68

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.

remix_source_image_filestring binary

Optional. The image to transform, as raw bytes; only JPEG, PNG and WEBP are supported. Multipart requests only. Supply this or remix_source_image, never both.

remix_image_weightinteger

Optional. How closely the result should follow the source image, from 1 to 100. Only valid alongside a remix source. When omitted the server chooses a value from your prompt, which is the usual case.

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": "ON",
  "seed": 12345,
  "resolution": "2048x2048",
  "remix_source_image": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  }
}

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"
}