Skip to main content
Vidu image generation

Vidu image generation — Create a task

Generate or edit images with Vidu reference-to-image models

POST
/services/aigc/image-generation/generation
# 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}
}'
{
  "output": {
    "task_status": "PENDING",
    "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
  },
  "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}
vidu/vidu-image_reference2image generates images from text, edits an existing image, or generates an image from one or more reference images. It renders Chinese and English text precisely and reproduces UI, chart, and design details at the pixel level, which makes it suitable for posters and infographics. 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.
  • Prompt: up to 5,000 characters. At least one non-empty text is required.
  • Reference images: up to 14 images. PNG, JPG, or WEBP; aspect ratio 1:4 to 4:1; total size up to 50 MB.
  • Output: one PNG image per task. Supported sizes are 1K, 2K, and 4K.
Processing is asynchronous: this operation returns a task_id, and you poll Query the result until the task finishes. Image generation typically takes 10 to 60 seconds.

Authorizations

string
header
required

QwenCloud API key. See Get an API key.

Header Parameters

enum<string>
required

The content type of the request. Must be application/json.

application/json
enum<string>
required

Enables asynchronous processing. HTTP requests support only asynchronous calls, so this must be enable. If the header is missing, the request fails with current user api does not support synchronous calls.

enable

Body

application/json
enum<string>
required

The model name.

vidu/vidu-image_reference2image
vidu/vidu-image_reference2image
object
required

The input object.

object

Image generation parameters.

Response

200-application/json
string

Unique request identifier for tracing and troubleshooting.

object
string

Error code. Returned only when the request fails.

string

Detailed error message. Returned only when the request fails.