Skip to main content
Vidu

Vidu-Image Generation API Reference

The Vidu Image Generation models support text-to-image , image editing and reference image-to-image tasks.

Model Overview

Model

Capabilities

Input Modality

Output Image Specifications

vidu/vidu-image_reference2image

Reference image generation, text-to-image, image editing. Precise rendering of Chinese and English text, pixel-level restoration of UI/charts and design details. Ideal for posters, infographics, etc.

Text, Image

Resolution: 1K, 2K, 4K

Number of images: 1

Image format: PNG

Prerequisites

  1. Activate the service: Go to the Model Studio console, search for "Vidu", find the corresponding model card, and click Activate Now to confirm activation and authorization in the pop-up window.
  2. Configure API Key: Select a region and Obtain an API key.

HTTP Call

Image generation tasks take a certain amount of time and the API uses asynchronous calls. The process involves "Create Task -> Poll for Results" two core steps, as follows:

Step 1: Submit Image Generation Task

Singapore region: POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/image-generation/generation

Request Parameters

Headers
Content-Type string (Required)The content type of the request. Must be application/json.Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.X-DashScope-Async string (Required)Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be enable.
If this request header is missing, the error "current user api does not support synchronous calls" is returned.
Request Body
model string (Required)Model name. Available values:
  • vidu/vidu-image_reference2image
input object (Required)Input parameter object containing the following fields:

Properties

messages array (Required)Message list. The server extracts the first non-empty text as the prompt and extracts all image fields as reference images. The array contains exactly one object with role and content properties.

Properties

rolestring (Optional)Role of the message. Recommended value: user.contentarray (Required)Message content, containing text prompts (text) and optional reference images (image, multiple supported).

Properties

textstring(Conditionally Required)Positive prompt describing the desired image content, style, and composition.Supports both Chinese and English. Maximum length is 5,000 characters, where each character (Chinese, letter, digit, or symbol) counts as one.Example: A sitting orange cat with a happy expression, lively and cute, realistic and accurate.Note: At least one non-empty text is required in the messages.image string (Optional)URL of a reference image. Multiple images are supported. All models support up to 14 reference images.Image constraints:
  • Formats: PNG, JPG, WEBP.
  • Aspect ratio: Between 1:4 and 4:1.
  • File size: Total size of all images must not exceed 50 MB.
  • Quantity: Up to 14 reference images.
parameters object (Optional)Image generation parameters.

Properties

size string (Optional)Image size in the format width*height (e.g., 2048*2048). Defaults to 1024*1024 if not specified.See the Supported Image Sizes section below for the list of supported sizes per model.n integer (Optional)Number of images to generate. Currently only 1 is supported. Other values will return a parameter error.seed integer (Optional)Random number seed. Valid range: [0,2147483647]. 0 means random.Using the same seed yields similar outputs. If omitted, the algorithm uses a random seed.watermark bool (Optional)Whether to add a watermark.
  • false: Default. No watermark.
  • true: Add watermark.
  • Text-to-Image
  • Reference Image-to-Image
Supported by all Vidu models.
# Singapore region. Replace {WorkspaceId} with your Bailian workspace ID. URLs vary by region.
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/image-generation/generation' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "model": "vidu/vidu-image_reference2image",
    "input": {
        "messages": [
            {
                "role": "user",
                "content": [
                    {
                        "text": "A flower shop with exquisite windows, a beautiful wooden door, displaying flowers"
                    }
                ]
            }
        ]
    },
    "parameters": {
        "size": "1024*1024",
        "n": 1,
        "watermark": false
    }
}'

Response Parameters

request_id stringUnique request identifier for tracing and troubleshooting.code stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes.
  • Successful response
  • Error response
Save the task_id to query the task status and result.
{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Step 2: Query Task Results

Singapore region: GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}
  • Polling recommendation: Image generation takes time. It is recommended to use a polling mechanism with a reasonable query interval (e.g., 5 seconds) to obtain results.
  • Task status flow: PENDING (waiting) → RUNNING (processing) → SUCCEEDED (success) / FAILED (failure).
  • Image link validity: Download links for generated images are valid for 24 hours. Please download and save images promptly.

Request Parameters

Headers
Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.task_id string (Required)The ID of the task.
  • Query Task Results
# Singapore region. Replace {WorkspaceId} with your Bailian workspace ID. URLs vary by region.
curl --location --request GET 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response Parameters

output objectTask output information.

Properties

task_id stringTask ID.choices arrayImage output candidate list, returned only when task_status=SUCCEEDED.

Properties

finish_reason stringReason for completion. Typically stop on success.message objectMessage returned by the model.

Properties

rolestringRole of the message, fixed as assistant.contentarray

Properties

type stringType of the output content, fixed as image.image stringDownload link for the generated image in PNG format. The link is valid for 24 hours. Please download and save the image promptly.
finished boolWhether the task is finished, returned only when task_status=SUCCEEDED.
usage objectResource usage information. Only counts successful results.

Properties

image_count integerNumber of generated images.size stringResolution of the generated image in width*height format. Example: 2048*2048.SR stringResolution tier of the generated image. Example: 2K.
request_id stringUnique request identifier for tracing and troubleshooting.code stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes.
  • Task Succeeded
  • Task Failed
{
    "request_id": "f584a817-6e00-9841-961a-49f7382a03d4",
    "output": {
        "task_id": "6404d4ec-4cdf-45b5-8d7d-3d429c6baed5",
        "task_status": "SUCCEEDED",
        "submit_time": "2026-07-13 20:27:41.291",
        "scheduled_time": "2026-07-13 20:27:41.320",
        "end_time": "2026-07-13 20:28:39.767",
        "finished": true,
        "choices": [
            {
                "finish_reason": "stop",
                "message": {
                    "role": "assistant",
                    "content": [
                        {
                            "image": "https://example.com/generated-image.png",
                            "type": "image"
                        }
                    ]
                }
            }
        ]
    },
    "usage": {
        "SR": "2K",
        "size": "2048*2048",
        "image_count": 1
    }
}

Error codes

If the model call fails and returns an error message, see Error codes for resolution.

Supported Image Sizes

vidu-image

Resolution

Supported Sizes

1K

1024*1024, 720*1440, 1440*720, 1024*768, 768*1024, 1920*1088, 1088*1920, 1536*1024, 1024*1536, 1920*816, 816*1920

2K

2048*2048, 1088*2160, 2160*1088, 2736*2048, 2048*2736, 2560*1440, 1440*2560, 3072*2048, 2048*3072, 2560*1104, 1104*2560

4K

2880*2880, 1440*2880, 2880*1440, 3312*2480, 2480*3312, 3840*2160, 2160*3840, 3520*2352, 2352*3520, 3840*1648, 1648*3840

Text Generation
Image Generation
Video Generation
World models
Audio
  • Audio generation
Realtime API
Text Embedding
Decision Model
TokenPlan
Model Production