Skip to main content
Third-party models

Vidu

Generate images and videos with Vidu models through the DashScope HTTP API on QwenCloud.

Quick start

Supported regions: Singapore only. Use an API key created in that region and the https://ap-southeast-1.maas.qwencloudapi.com endpoint. See Regions and endpoints. Vidu models cover image generation and video generation. All models use the DashScope HTTP API with asynchronous tasks: submit a task, then poll /tasks/{task_id} for the result.
ModelTypeUse this when
vidu/vidu-image_reference2imageImage generationText-to-image, image editing, and reference image-to-image. Precise Chinese and English text rendering, pixel-level UI and chart details.
vidu/viduq3-ad_reference2videoReference-to-videoAdvertising videos with marketing-grade transitions, camera movement, and audio.
vidu/viduq3-drama_reference2videoReference-to-videoPremium dramas and AI comics with strong character consistency and emotional expression.
vidu/viduq3-mix_reference2videoReference-to-videoGeneral reference-to-video with balanced visual quality and motion.
vidu/viduq2-pro-fast_img2videoImage-to-videoAnimating a first-frame image with a text prompt, at low cost.
Before you begin, get an API key and set it as an environment variable.

Image generation

vidu/vidu-image_reference2image accepts a text prompt and up to 14 reference images. The server uses the first non-empty text as the prompt and all image entries as references.
  • Text-to-image
  • Reference image-to-image
# Singapore (ap-southeast-1). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --location 'https://ap-southeast-1.maas.qwencloudapi.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 ornate windows, a beautiful wooden door, and flowers on display"}
        ]
      }
    ]
  },
  "parameters": {"size": "1024*1024", "n": 1, "watermark": false}
}'
Image generation parameters:
ParameterTypeRequiredDescription
sizestringNoOutput size in width*height format. Default: 1024*1024. Tiers: 1K, 2K, 4K.
nintegerNoNumber of images. Only 1 is supported.
seedintegerNoRandom seed, 0 to 2147483647. 0 means random.
watermarkbooleanNoWhether to add a watermark. Default: false.
Supported sizes:
TierSizes
1K1024*1024, 720*1440, 1440*720, 1024*768, 768*1024, 1920*1088, 1088*1920, 1536*1024, 1024*1536, 1920*816, 816*1920
2K2048*2048, 1088*2160, 2160*1088, 2736*2048, 2048*2736, 2560*1440, 1440*2560, 3072*2048, 2048*3072, 2560*1104, 1104*2560
4K2880*2880, 1440*2880, 2880*1440, 3312*2480, 2480*3312, 3840*2160, 2160*3840, 3520*2352, 2352*3520, 3840*1648, 1648*3840

Video generation

Video tasks return a task_id. Poll the task until task_status is SUCCEEDED, then download the video from output.video_url. Generation typically takes 1 to 5 minutes.

Image-to-video

vidu/viduq2-pro-fast_img2video takes exactly one image and an optional prompt.
# Singapore (ap-southeast-1). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --location 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis' \
  --header 'X-DashScope-Async: enable' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "vidu/viduq2-pro-fast_img2video",
  "input": {
    "media": [
      {"type": "image", "url": "https://example.com/first-frame.png"}
    ],
    "prompt": "The camera slowly pans up from below a sea turtle swimming leisurely."
  },
  "parameters": {"duration": 5, "resolution": "720P", "watermark": false}
}'

Reference-to-video

Reference-to-video models take 1 to 7 reference images and keep the subject consistent across scenes.
# Singapore (ap-southeast-1). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --location 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis' \
  --header 'X-DashScope-Async: enable' \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "vidu/viduq3-ad_reference2video",
  "input": {
    "prompt": "A man sits in a chair by a window, holding a guitar and playing a soothing American country folk song in a cafe.",
    "media": [
      {"type": "image", "url": "https://example.com/reference.png"}
    ]
  },
  "parameters": {"resolution": "720P", "size": "1280*720", "duration": 5, "audio": false, "watermark": false}
}'
Video parameters:
ParameterApplies toDescription
resolutionAll720P or 1080P. It directly affects billing. Defaults: viduq3-ad 720P, viduq3-drama 1080P, viduq3-mix 720P.
sizeReference-to-videoOutput size in width*height format. Defaults to 1280*720 for 720P and 1920*1080 for 1080P. viduq3-drama supports only 16:9 and 9:16.
durationAllVideo length in seconds. viduq3-ad 3 to 15, viduq3-drama 2 to 15, viduq3-mix 1 to 16, viduq2-pro-fast 1 to 10. Default: 5.
audioReference-to-videoWhether to generate audio. Supported by viduq3-ad and viduq3-mix. viduq3-drama always outputs audio.
watermarkAllWhether to add the watermark "Generated by AI" in the lower-right corner. Default: false.
seedAllRandom seed, 0 to 2147483647. A fixed seed improves reproducibility.

Poll for the result

import os
import time

import requests

api_key = os.getenv("DASHSCOPE_API_KEY")
# Singapore (ap-southeast-1). This model is available only in this region.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
base_url = "https://ap-southeast-1.maas.qwencloudapi.com/api/v1"

headers = {"Authorization": f"Bearer {api_key}"}

task_id = "0385dc79-5ff8-4d82-bcb6-xxxxxx"

while True:
  response = requests.get(f"{base_url}/tasks/{task_id}", headers=headers, timeout=30)
  output = response.json()["output"]
  status = output["task_status"]
  print(status)

  if status == "SUCCEEDED":
    print(output["video_url"])
    break

  if status == "FAILED":
    print(output.get("code"), output.get("message"))
    break

  time.sleep(5)
The video URL is valid for 24 hours. Download the video promptly.

Models and pricing

ModelBillingPrice (USD)
vidu/vidu-image_reference2imagePer image1K 0.10,2K0.10, 2K 0.16, 4K $0.24
vidu/viduq3-ad_reference2videoPer second720P 0.125,1080P0.125, 1080P 0.15
vidu/viduq3-drama_reference2videoPer second720P 0.14,1080P0.14, 1080P 0.14
vidu/viduq3-mix_reference2videoPer second720P 0.12,1080P0.12, 1080P 0.145
vidu/viduq2-pro-fast_img2videoPer second720P 0.016,1080P0.016, 1080P 0.032
All Vidu models have a rate limit of 300 RPM. For the current price in your region, see Model prices.

Notes

  • Same region: The model, endpoint, and API key must belong to the same region.
  • Asynchronous only: Every Vidu request requires the X-DashScope-Async: enable header.
  • Task ID validity: A task_id is valid for 24 hours. Do not submit the same task again while polling.
  • Image requirements: Images must be publicly accessible. Supported formats are JPG, JPEG, PNG, and WEBP, with an aspect ratio between 1:4 and 4:1.

Error codes

If a model call fails and returns an error message, see Error codes.