Skip to content

Wan 2.7 Image Generation

Alibaba Wan 2.7 image generation model — flagship quality with 4K resolution, sequential image generation, and thinking mode. Delivers excellent Chinese and English understanding and generation capabilities.

Models

ModelDescription
wan2.7-image-proFlagship edition, supports 4K
wan2.7-imageStandard edition, up to 2K

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="wan2.7-image-pro",
    prompt="A flower shop with ornate stained-glass windows",
    size="2048x2048",
    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 ID: wan2.7-image-pro or wan2.7-image
promptstringYesImage description text (CN/EN supported)
sizestringNo1024x1024Image dimensions (width x height), see supported sizes
nintegerNo1Number of images: 1-4 (standard), 1-12 (sequential mode)
response_formatstringNourlResponse format: url or b64_json

Extended Parameters

Wan 2.7 supports additional parameters via the parameters object:

FieldTypeRequiredDefaultDescription
parameters.enable_sequentialbooleanNofalseEnable sequential generation mode for stylistically consistent image sets
parameters.thinking_modebooleanNotrueThinking mode — the model analyzes the prompt before generating for accuracy
parameters.color_palettestringNoColor palette to specify the overall tone and style of the generated images
parameters.watermarkbooleanNofalseWhether to add an AI-generated watermark
parameters.seedintegerNoRandom seed for reproducibility
json
{
  "model": "wan2.7-image-pro",
  "prompt": "A flower shop with ornate stained-glass windows",
  "size": "2048x2048",
  "parameters": {
    "thinking_mode": true,
    "watermark": false,
    "seed": 42
  }
}

Note

Wan 2.7 models do not support negative_prompt (negative prompts) or prompt_extend (prompt expansion) parameters.

Supported Sizes

wan2.7-image-pro (Flagship, up to 4K)

SizeAspect Ratio
4096x40961:1
4096x230416:9
2304x40969:16
4096x30724:3
3072x40963:4
2048x20481:1
2688x153616:9
1536x26889:16
2368x17284:3
1728x23683:4
1024x10241:1
1696x96016:9
960x16969:16
1472x11044:3
1104x14723:4
1248x8323:2
832x12482:3

wan2.7-image (Standard, up to 2K)

SizeAspect Ratio
2048x20481:1
2688x153616:9
1536x26889:16
2368x17284:3
1728x23683:4
1024x10241:1
1696x96016:9
960x16969:16
1472x11044:3
1104x14723:4
1248x8323:2
832x12482:3

Request Examples

bash
curl https://open.dieyuyun.com/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.7-image-pro",
    "prompt": "A flower shop with ornate stained-glass windows",
    "size": "2048x2048",
    "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="wan2.7-image-pro",
    prompt="A flower shop with ornate stained-glass windows",
    size="2048x2048",
    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: 'wan2.7-image-pro',
  prompt: 'A flower shop with ornate stained-glass windows',
  size: '2048x2048',
  n: 1,
})

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

Sequential Generation Example

Enable enable_sequential to generate stylistically consistent image sets — ideal for comic strips, storyboards, and series assets:

bash
curl https://open.dieyuyun.com/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.7-image-pro",
    "prompt": "A kitten playing in a garden, spring, bright sunshine, watercolor style",
    "size": "1024x1024",
    "n": 4,
    "parameters": {
      "enable_sequential": true
    }
  }'
python
from openai import OpenAI

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

response = client.images.generate(
    model="wan2.7-image-pro",
    prompt="A kitten playing in a garden, spring, bright sunshine, watercolor style",
    size="1024x1024",
    n=4,
    parameters={
        "enable_sequential": True
    }
)

for img in response.data:
    print(img.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: 'wan2.7-image-pro',
  prompt: 'A kitten playing in a garden, spring, bright sunshine, watercolor style',
  size: '1024x1024',
  n: 4,
  parameters: {
    enable_sequential: true,
  },
})

for (const img of response.data) {
  console.log(img.url)
}

Response Format

Success Response

json
{
  "created": 1717000000,
  "data": [
    {
      "url": "https://...",
      "revised_prompt": "A charming French-style flower shop with ornate stained-glass windows in vibrant colors, window sills overflowing with fresh blooms"
    }
  ],
  "usage": {
    "generated_images": 1,
    "total_tokens": 0
  }
}
FieldTypeDescription
createdintegerUnix timestamp
dataarrayArray of generated results
data[].urlstringImage URL
data[].revised_promptstringThe revised/optimized prompt used
usageobjectUsage statistics
usage.generated_imagesintegerNumber of generated images
usage.total_tokensintegerTotal tokens consumed

Error Response

See Error Codes for details.

Best Practices

  • Thinking mode: Enabled by default via thinking_mode. The model analyzes the prompt before generating, significantly improving accuracy and detail.
  • 4K output: Use wan2.7-image-pro with 4K sizes (e.g. 4096x4096) for print materials, advertising assets, and other high-fidelity use cases.
  • Sequential generation: Enable enable_sequential to expand the n range to 1-12, generating stylistically consistent image series — perfect for comic strips and storyboards.
  • Color palette: Use color_palette to specify a tone style such as "warm tones" or "Morandi palette" for quick visual consistency.
  • Prompt tips: The more specific the description, the better the result. Include details about scene, lighting, style, and composition.
  • Reproducibility: Save the seed value to reproduce similar results for iterative refinement.
  • Watermark control: Watermarks are disabled by default (watermark: false), so no extra steps are needed for commercial use.

Rate Limits

See Rate Limits for details.