Skip to content

Z-Image Turbo Image Generation

Alibaba Z-Image Turbo — a fast, cost-effective image generation model excelling at high-fidelity portraits and product photos.

Quick Start

python
from openai import OpenAI

client = OpenAI(
    base_url="https://open.dieyuyun.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.images.generate(
    model="z-image-turbo",
    prompt="A cute orange tabby cat basking in sunlight on a windowsill",
    size="1024x1536",
    n=1
)

print(response.data[0].url)

Endpoint

ItemValue
MethodPOST
Path/v1/images/generations
Base URLhttps://open.dieyuyun.com
ProtocolOpenAI Images API

Authentication

Bearer Token: Authorization: Bearer YOUR_API_KEY

Standard Request Fields

FieldTypeRequiredDefaultDescription
modelstringYesModel identifier: z-image-turbo
promptstringYesImage description text
sizestringNo1024x1536Image size, total pixels must be within [512², 2048²]
nintegerNo1Number of images — fixed at 1, batch generation not supported
response_formatstringNourlResponse format: url or b64_json

Important Notes

  • n is fixed at 1: Z-Image Turbo does not support batch generation. Each request produces exactly 1 image.
  • No negative_prompt support: This model does not accept negative prompt parameters.
  • No watermark parameter: This model does not have a watermark control parameter.

Supported Sizes

SizeAspect RatioDescription
1024x10241:1Square
1280x12801:1Large square
1536x15361:1Extra-large square
1024x15362:3Portrait (default)
1104x14723:4Portrait
896x11843:4Small portrait
768x13609:16Vertical screen
960x17049:16Large vertical screen
1152x20489:16Extra-large vertical
1328x17603:4Large portrait
1704x96016:9Large horizontal screen
1760x13284:3Large landscape
2048x115216:9Extra-wide screen
1360x76816:9Horizontal screen
1184x8964:3Landscape
1472x11044:3Large landscape

Size Guidelines

Total pixel count must be within [512², 2048²]. The sizes listed above are recommended; you may also pass custom sizes as long as they satisfy the total pixel constraint.

Extended Parameters

Z-Image Turbo supports additional parameters via the parameters object:

FieldTypeRequiredDefaultDescription
parameters.prompt_extendbooleanNofalseWhether to optimize the prompt. When enabled, returns a revised prompt and thinking process. Costs more.
parameters.seedintegerNoRandom seed in range [0, 2147483647] for reproducible results
json
{
  "model": "z-image-turbo",
  "prompt": "A cute orange tabby cat basking in sunlight on a windowsill",
  "size": "1024x1536",
  "parameters": {
    "prompt_extend": true,
    "seed": 42
  }
}

About prompt_extend

Unlike Qwen Image, Z-Image Turbo defaults prompt_extend to false. When enabled:

  • The response includes revised_prompt (optimized prompt) and reasoning_content (thinking process)
  • Generation quality may improve, but token usage and cost will increase

Request Examples

bash
curl https://open.dieyuyun.com/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "A cute orange tabby cat basking in sunlight on a windowsill",
    "size": "1024x1536",
    "n": 1
  }'
python
from openai import OpenAI

client = OpenAI(
    base_url="https://open.dieyuyun.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.images.generate(
    model="z-image-turbo",
    prompt="A cute orange tabby cat basking in sunlight on a windowsill",
    size="1024x1536",
    n=1
)

print(response.data[0].url)
javascript
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://open.dieyuyun.com/v1',
  apiKey: 'YOUR_API_KEY',
})

const response = await client.images.generate({
  model: 'z-image-turbo',
  prompt: 'A cute orange tabby cat basking in sunlight on a windowsill',
  size: '1024x1536',
  n: 1,
})

console.log(response.data[0].url)

Enable Prompt Optimization Example

bash
curl https://open.dieyuyun.com/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "A cute orange tabby cat basking in sunlight on a windowsill",
    "size": "1024x1536",
    "n": 1,
    "parameters": {
      "prompt_extend": true,
      "seed": 42
    }
  }'

Response Format

Success Response (prompt_extend=false)

json
{
  "created": 1717000000,
  "data": [
    {
      "url": "https://..."
    }
  ]
}

Success Response (prompt_extend=true)

json
{
  "created": 1717000000,
  "data": [
    {
      "url": "https://...",
      "revised_prompt": "A vibrant orange tabby cat lazily lying on a sun-drenched windowsill, warm afternoon light streaming through the glass, detailed fur texture visible, cozy home interior in the background",
      "reasoning_content": "The user wants an image of an orange cat sunbathing on a windowsill. I should enhance this prompt with more detail about lighting, fur texture, and ambient atmosphere to produce a more realistic image..."
    }
  ]
}
FieldTypeDescription
createdintegerUnix timestamp
dataarrayArray of generated results
data[].urlstringImage URL
data[].revised_promptstringOptimized prompt (only returned when prompt_extend=true)
data[].reasoning_contentstringModel's thinking process (only returned when prompt_extend=true)

Error Response

See Error Codes for details.

Best Practices

  • Speed first: Z-Image Turbo is built for fast generation, making it ideal for high-volume scenarios like e-commerce product images and social media assets.
  • Portraits & product photos: This model excels at high-fidelity portraits and product photography, well-suited for e-commerce and advertising use cases.
  • Prompt optimization: For simple prompts, use the default setting (prompt_extend=false) to save costs. For complex scenes, enable prompt_extend for better results.
  • Seed for reproducibility: Use the seed parameter to reproduce previous results, making it easy to iterate on images you like.
  • Size selection: The default size 1024x1536 works well for portrait shots; for product images, choose square (1024x1024) or landscape sizes as needed.
  • Synchronous response: This model returns results synchronously. No task_id polling is needed.

Rate Limits

See Rate Limits for details.