Z-Image Turbo Image Generation
Alibaba Z-Image Turbo — a fast, cost-effective image generation model excelling at high-fidelity portraits and product photos.
Try it Online
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
| Item | Value |
|---|---|
| Method | POST |
| Path | /v1/images/generations |
| Base URL | https://open.dieyuyun.com |
| Protocol | OpenAI Images API |
Authentication
Bearer Token: Authorization: Bearer YOUR_API_KEY
Standard Request Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | — | Model identifier: z-image-turbo |
| prompt | string | Yes | — | Image description text |
| size | string | No | 1024x1536 | Image size, total pixels must be within [512², 2048²] |
| n | integer | No | 1 | Number of images — fixed at 1, batch generation not supported |
| response_format | string | No | url | Response 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
| Size | Aspect Ratio | Description |
|---|---|---|
1024x1024 | 1:1 | Square |
1280x1280 | 1:1 | Large square |
1536x1536 | 1:1 | Extra-large square |
1024x1536 | 2:3 | Portrait (default) |
1104x1472 | 3:4 | Portrait |
896x1184 | 3:4 | Small portrait |
768x1360 | 9:16 | Vertical screen |
960x1704 | 9:16 | Large vertical screen |
1152x2048 | 9:16 | Extra-large vertical |
1328x1760 | 3:4 | Large portrait |
1704x960 | 16:9 | Large horizontal screen |
1760x1328 | 4:3 | Large landscape |
2048x1152 | 16:9 | Extra-wide screen |
1360x768 | 16:9 | Horizontal screen |
1184x896 | 4:3 | Landscape |
1472x1104 | 4:3 | Large 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:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| parameters.prompt_extend | boolean | No | false | Whether to optimize the prompt. When enabled, returns a revised prompt and thinking process. Costs more. |
| parameters.seed | integer | No | — | Random 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) andreasoning_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..."
}
]
}| Field | Type | Description |
|---|---|---|
| created | integer | Unix timestamp |
| data | array | Array of generated results |
| data[].url | string | Image URL |
| data[].revised_prompt | string | Optimized prompt (only returned when prompt_extend=true) |
| data[].reasoning_content | string | Model'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, enableprompt_extendfor better results. - Seed for reproducibility: Use the
seedparameter to reproduce previous results, making it easy to iterate on images you like. - Size selection: The default size
1024x1536works 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.
Related Documentation
- Wan 2.7 - Alibaba Wan video generation model
- Qwen Image - Tongyi Wanxiang image generation model
- Model List & Pricing - Browse available models and pricing
- Playground - Test image generation interactively