Skip to content

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

FieldTypeRequiredDescription
modelstringYesModel name, supports wan2.6-i2v, wan2.6-i2v-flash, wan2.5-i2v-preview
input.promptstringYesText prompt describing the expected video content
input.img_urlstringYesFirst frame image URL or Base64 data; image size must match output resolution
input.audio_urlstringNoAudio file URL, supports wav/mp3, duration 3-30s, file size up to 15MB
input.negative_promptstringNoNegative prompt describing content to avoid
input.templatestringNoVideo effect template name
parameters.prompt_extendbooleanNoWhether to enable prompt rewriting, default true
parameters.durationintegerYesVideo duration in seconds; supported values depend on model
parameters.shot_typestringNoShot type, single or multi, only effective when prompt_extend=true
parameters.seedintegerNoRandom seed, range [0,2147483647]
parameters.resolutionstringYesOutput resolution tier, supports 480P, 720P, 1080P; available options depend on model
parameters.audiobooleanNoWhether 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

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"
  }
}