Create a reference video task
Generates a video guided by reference images, and depending on the model, reference videos and audio.
Each model accepts different references:
tbkv1.0.1,tbkv1.0(Tsubaki): 1–6 images, no videos, up to 3 audio clips,duration5–15.v4.0,v4.0.1(Seedance 2, Seedance 2 Fast): up to 9 images, up to 3 videos, up to 3 audio clips,duration4–15.v4.0.3(Seedance 2.5): up to 30 images, up to 10 videos, up to 10 audio clips,duration4–30.v3.3(Vidu): 1–7 images, no videos or audio,duration3–16.
Every model needs at least one image or video, except v4.0.3, which also accepts audio alone.
Reference files must meet these limits:
- Video: MP4 or MOV, H.264 or HEVC, 24–60 fps, 2–15 s per clip and 15 s in total (30 s on
v4.0.3), up to 50 MB (200 MB onv4.0.3). - Audio: WAV or MP3, 2–15 s per clip and 15 s in total (30 s on
v4.0.3), under 15 MiB.
Check a file with GET /v2/media/{mediaId}/info before sending it. On v4.0 and v4.0.1, counts and clip lengths are checked after the task is charged: a task that breaks them fails instead of being refused.
Credits are charged when the task is created. Poll GET /v2/task/{id} for the result; a finished task's video is outputs.videoMediaId.
Authorization
bearerAuth In all requests that require authentication
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST https://api.pixai.art/v2/reference-video/create \ -H "Authorization: Bearer $PIXAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "tbkv1.0.1", "prompt": "the girl walks through the city at night", "referenceImageMediaIds": ["1943547603237249965"], "ratio": "9:16", "duration": 5 }'{
"id": "string",
"status": "waiting",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"endAt": "2019-08-24T14:15:22Z",
"taskKind": "string",
"paidQuota": 0,
"taskStatusMsgI18n": {
"key": "string",
"defaultMessage": "string"
},
"outputs": {
"videoMediaId": "string",
"seed": "string",
"mediaIds": [
"string"
],
"mediaUrls": [
"string"
]
}
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}Create an image-to-video task POST
Animates an image into a video with PixAI's Tsubaki video model. The video starts on `firstFrameMediaId` and, when you send `lastFrameMediaId`, ends on it. The output keeps the first frame's aspect ratio.
Get a task GET
Reads a task created by any v2 endpoint. Poll it every few seconds until `status` is `completed`, `failed` or `cancelled`.