- Production:
https://batch.pipelet.net
- Create request:
POST /queue/:modelId - Check status:
GET /queue/:modelId/requests/:requestId/status - Cancel request:
PUT /queue/:modelId/requests/:requestId/cancel - Fetch result:
GET /queue/:modelId/requests/:requestId
- Text-to-Video:
wan22-fast-t2v,wan22-fast-t2v-premium,wan22-fast-t2v-pro - Image-to-Video:
wan22-fast-i2v,wan22-fast-i2v-premium,wan22-fast-i2v-pro
POST https://batch.pipelet.net/queue/:modelId
Headers:
Content-Type: application/jsonAuthorization: Bearer {your-bearer-token}
Body:
- For text-to-video models, provide a
promptfield with text prompts. - For image-to-video models, provide a
promptand adata_urifield with base64 encoded image. - Extra parameters are optional,
durationfor video length in seconds,widthandheightfor video resolution.
Supported Resolution:
- For text-to-video models, 1280x720, 720x1280, 480x832, 832x480, 512x512, 768x768
- For image-to-video models, only
heightis used, and we only support 720, 480 as input - For both models, maximum
durationfor 720p video is 5 seconds. For 480p video it can be 7 seconds.
Example (model wan22-fast-i2v):
curl 'https://batch.pipelet.net/queue/wan22-fast-i2v' \
-H 'Content-Type: application/json' \
-d '{"prompt": "A cat wearing a superman cape playing with a dog", "data_uri": "(base64 encoded image)", "duration": 5, "height": 720}'NOTE: to create a base64 encoded image, do something like base64 -i image.jpg
Example response:
{
"request_id": "12",
"response_url": "https://batch.pipelet.net/queue/wan22-fast-i2v/requests/12",
"status_url": "https://batch.pipelet.net/queue/wan22-fast-i2v/requests/12/status",
"cancel_url": "https://batch.pipelet.net/queue/wan22-fast-i2v/requests/12/cancel"
}Notes:
request_idis your handle for this job for future requests- Use
status_urlto poll for progress. - Use
response_urlto fetch the completed result. - Use
cancel_urlto cancel if the job has not started yet.
GET https://batch.pipelet.net/queue/:modelId/requests/:requestId/status
Example:
curl https://batch.pipelet.net/queue/wan22-fast-i2v/requests/12/statusPossible responses:
- In progress
{
"status": "IN_PROGRESS",
"statusMessages": {
"message": "PROCESSING",
"detail_message": "Progress: 4/24 Tasks done"
},
"response_url": "https://batch.pipelet.net/queue/wan22-fast-i2v/requests/12"
}NOTE: Once a video starts generating, it usually takes 90 seconds to complete for 480p video. For 720p video it takes 180 seconds.
- In queue (not started yet). You will also see the current
queue_position, starting at index 0: It means how many jobs are in front of you in the queue.
{
"status": "IN_QUEUE",
"queue_position": 1,
"statusMessages": {},
"response_url": "https://batch.pipelet.net/queue/wan22-fast-i2v/requests/16"
}- Other terminal states:
COMPLETED,FAILED,CANCELLED. NOTE: always check statusMessages for details.
PUT https://batch.pipelet.net/queue/:modelId/requests/:requestId/cancel
- Right now it is only possible to cancel while status is IN_QUEUE (not started).
Example:
curl -XPUT https://batch.pipelet.net/queue/wan22-fast-i2v/requests/16/cancelIf successful, a 204 No Content response is returned; otherwise a conflict (409) is returned if it has already started.
GET https://batch.pipelet.net/queue/:modelId/requests/:requestId
When the job status becomes COMPLETED, fetch the result from the response_url:
curl -XGET https://batch.pipelet.net/queue/wan22-fast-i2v/requests/13Typical response body:
{
"video": {
"data_uri": "(base64_encoded mp4 file content like 4AAQkZJRgABAxxx)"
}
}- JSON
video.data_uriis a base64-encoded string of an MP4 file encoded with H.264. - Decode and save it locally to obtain the final
.mp4file
Example to save locally (macOS/Linux):
curl -s https://batch.pipelet.net/queue/wan22-fast-i2v/requests/13 \
| jq -r '.video.data_uri' | base64 --decode > output.mp4All the previous pipelines will produce base64-encoded video files in the response body directly.
If you wish to swtich to the S3-presigned URL, add a HTTP header x-pipelet-output: binary to the create request, and the result will be a S3-presigned URL instead.