Skip to content

Reference-to-Video

Ali Bailian reference-to-video API for generating multi-character interactive videos from text and reference materials.


Overview

  • Method: POST
  • Path: /task/bailian/ref2video
  • Content-Type: application/json
  • Category: Video Models (Video) / Ali Bailian

Authentication

  • Header: Authorization: Bearer <token>

Request Parameters

FieldTypeRequiredDescription
modelstringYesModel name, supports wan2.6-r2v-flash, wan2.6-r2v
input.promptstringYesText prompt describing expected video elements and visual characteristics, supports character references such as character1, character2
input.reference_urlsarray[string]YesArray of reference material URLs, supports images and videos, up to 5 files
input.negative_promptstringNoNegative prompt describing content to avoid in the video
parameters.durationintegerNoVideo duration in seconds; wan2.6-r2v-flash and wan2.6-r2v support 2-10 seconds, default 5 seconds
parameters.shot_typestringNoShot type, single or multi, affects video shot composition
parameters.seedintegerNoRandom seed, range [0, 2147483647]
parameters.audiobooleanNoWhether to generate audio; audio affects cost
parameters.sizestringYesVideo resolution in width*height format, default 1920*1080, available options depend on model

Request Example

curl Example

bash
curl -X POST "https://api.gpt.ge/task/bailian/ref2video" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $YOUR_TOKEN" \
  -d '{
    "model": "wan2.6-r2v-flash",
    "input": {
      "prompt": "Character2 sits in a chair by the window holding character3, playing a soothing American country song next to character4. Character1 says to Character2: 'Sounds good'.",
      "reference_urls": [
        "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4",
        "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4",
        "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png",
        "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
      ]
    },
    "parameters": {
      "size": "1280*720",
      "duration": 10,
      "audio": true,
      "shot_type": "multi"
    }
  }'

JavaScript (fetch) Example

javascript
fetch('https://api.gpt.ge/task/bailian/ref2video', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  body: JSON.stringify({
    model: 'wan2.6-r2v-flash',
    input: {
      prompt: 'Character2 sits in a chair by the window holding character3, playing a soothing American country song next to character4. Character1 says to Character2: "Sounds good".',
      reference_urls: [
        'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4',
        'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4',
        'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png',
        'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png'
      ]
    },
    parameters: {
      size: '1280*720',
      duration: 10,
      audio: true,
      shot_type: 'multi'
    }
  })
})
  .then(res => res.json())
  .then(console.log)

Python (requests) Example

python
import requests

payload = {
    'model': 'wan2.6-r2v-flash',
    'input': {
        'prompt': 'Character2 sits in a chair by the window holding character3, playing a soothing American country song next to character4. Character1 says to Character2: "Sounds good".',
        'reference_urls': [
            'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4',
            'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4',
            'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png',
            'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png'
        ]
    },
    'parameters': {
        'size': '1280*720',
        'duration': 10,
        'audio': True,
        'shot_type': 'multi'
    }
}

resp = requests.post(
    'https://api.gpt.ge/task/bailian/ref2video',
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_TOKEN'
    },
    json=payload
)
print(resp.json())

Response Fields

FieldTypeDescription
request_idstringRequest ID
outputobjectOutput task information
output.task_idstringTask ID
output.task_statusstringTask status

Response Example (200)

json
{
  "request_id": "9f829e8a-6db3-4998-8515-134223f0fc11",
  "output": {
    "task_id": "ac22cbc8-3fb3-45b6-9091-d8a7b41650bc",
    "task_status": "PENDING"
  }
}