Skip to content

Image To Video

POST https://api.newportai.com/api/async/img2video

Image_to_video allows users to upload an image and provide a descriptive prompt. The API animates the four seconds video content in the image based on the prompt, making elements within the image move or change, without altering the scene itself.

Request Headers

  • Content-TypestringRequired
    Enum
    application/json
  • AuthorizationstringRequired
    Bearer authentication format, for example: Bearer

Request Body

  • promptstringRequired
    Less than 1,500 characters long.
  • imgUrlstringRequired
    The image format only supports JPG and PNG, with a size limit of 50MB. The aspect ratio needs to be less than 1:4 or 4:1.

Response

  • codeinteger
    0 success, or error code.
  • messagestring
    "success", or error msg.
  • dataobject
    taskIdstring
    Use the taskId to request the Polling API to retrieve the generated outputs.

Example

Drive image to videos.

Request:

zsh
curl -X POST 'https://api.newportai.com/api/async/img2video' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
  "prompt": "A person laughing loudly in the grass",
  "imgUrl": "https://dreamface-resource-new.s3.amazonaws.com/server/aigc/main/84536adddc574c3182d3fe0c99483965.jpg"
}'

Response:

json
{
  "code": 0,
  "message": "success", 
  "data": {
    "taskId": "d1ff79a198d5426080d2b1e838eac8e5"
  }
}

Next Step:

Use Polling API to get the result.

Demo
before