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
- 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.
- 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 ParametersHeadersContent-Typestring (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.Request Bodymodelstring (Required)Model name. Available values:
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 role string (Optional)Role of the message. Recommended value: user.contentarray (Required)Message content, containing text prompts (text) and optional reference images (image, multiple supported).
Properties text string(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.
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.
|
Supported by all Vidu models. |
Response Parametersrequest_idstringUnique 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. |
Save the task_id to query the task status and result. |
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 ParametersHeadersAuthorizationstring (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.task_id string (Required)The ID of the task. |
|
Response ParametersoutputobjectTask 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 role stringRole 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.boolWhether the task is finished, returned only when task_status=SUCCEEDED.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.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. |
|
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 |