Image-to-Video
Ali Bailian image-to-video API (based on a first frame) for generating video from a reference image and text prompt.
Overview
- Method:
POST - Path:
/task/bailian/image2video - Content-Type:
application/json - Category: Video Models (Video) / Ali Bailian
Authentication
- Header:
Authorization: Bearer <token>
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name, supports wan2.6-i2v, wan2.6-i2v-flash, wan2.5-i2v-preview |
| input.prompt | string | Yes | Text prompt describing the expected video content |
| input.img_url | string | Yes | First frame image URL or Base64 data; image size must match output resolution |
| input.audio_url | string | No | Audio file URL, supports wav/mp3, duration 3-30s, file size up to 15MB |
| input.negative_prompt | string | No | Negative prompt describing content to avoid |
| input.template | string | No | Video effect template name |
| parameters.prompt_extend | boolean | No | Whether to enable prompt rewriting, default true |
| parameters.duration | integer | Yes | Video duration in seconds; supported values depend on model |
| parameters.shot_type | string | No | Shot type, single or multi, only effective when prompt_extend=true |
| parameters.seed | integer | No | Random seed, range [0,2147483647] |
| parameters.resolution | string | Yes | Output resolution tier, supports 480P, 720P, 1080P; available options depend on model |
| parameters.audio | boolean | No | Whether to generate audio; only supported for wan2.6-i2v-flash, may reduce cost if false |
Request Example
curl Example
bash
curl -X POST "https://api.gpt.ge/task/bailian/image2video" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN" \
-d '{
"model": "wan2.6-i2v-flash",
"input": {
"prompt": "An urban fantasy art scene. A dynamic graffiti-style character painted in spray paint comes alive from a concrete wall. A young boy in a classic rap performer pose sings an English rap at high speed. The scene is set under a city railway bridge at night, lit by a solitary street lamp, creating a cinematic atmosphere full of energy and detail. The audio is entirely the boy\'s rap, with no additional dialogue or noise.",
"img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
},
"parameters": {
"resolution": "720P",
"prompt_extend": true,
"duration": 5,
"audio": true
}
}'JavaScript (fetch) Example
javascript
fetch('https://api.gpt.ge/task/bailian/image2video', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
model: 'wan2.6-i2v-flash',
input: {
prompt: 'An urban fantasy art scene. A dynamic graffiti-style character painted in spray paint comes alive from a concrete wall. A young boy in a classic rap performer pose sings an English rap at high speed. The scene is set under a city railway bridge at night, lit by a solitary street lamp, creating a cinematic atmosphere full of energy and detail. The audio is entirely the boy\'s rap, with no additional dialogue or noise.',
img_url: 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png'
},
parameters: {
resolution: '720P',
prompt_extend: true,
duration: 5,
audio: true
}
})
})
.then(res => res.json())
.then(console.log)Python Example (requests)
python
import requests
payload = {
'model': 'wan2.6-i2v-flash',
'input': {
'prompt': 'An urban fantasy art scene. A dynamic graffiti-style character painted in spray paint comes alive from a concrete wall. A young boy in a classic rap performer pose sings an English rap at high speed. The scene is set under a city railway bridge at night, lit by a solitary street lamp, creating a cinematic atmosphere full of energy and detail. The audio is entirely the boy\'s rap, with no additional dialogue or noise.',
'img_url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png'
},
'parameters': {
'resolution': '720P',
'prompt_extend': True,
'duration': 5,
'audio': True
}
}
resp = requests.post(
'https://api.gpt.ge/task/bailian/image2video',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
json=payload
)
print(resp.json())Response Fields
| Field | Type | Description |
|---|---|---|
| request_id | string | Request ID |
| output | object | Output task information |
| output.task_id | string | Task ID |
| output.task_status | string | Task status |
Response Example (200)
json
{
"request_id": "9f829e8a-6db3-4998-8515-134223f0fc11",
"output": {
"task_id": "ac22cbc8-3fb3-45b6-9091-d8a7b41650bc",
"task_status": "PENDING"
}
}