Photo Animer

Using artificial intelligence technology to make the input photos live according to the style, expression-driven static images may take a long time and require asynchronous methods to obtain the results, so we provide three interfaces to complete this process.

API documentation

Interface 1: Submit static image to generate moving video task

(1)Request parameters (Header)

ParameterParameter TypeDescription
APIKEYstringYour API Key

(2) Query String

ParameterParameter TypeDescription
imageUrlurlThe URL of the static image of the face
voiceUrlurlaudio file url.Template ID must be 0
outputFormatstringoutput format, avaiable values: gif. By default, a mp4 video is generated, if outputFormat is set to "gif", additional "gifUrl" field will be provided in response.
templateId0, 1, 2, 3, 4, 5 can be chosenExpression template index number, starting from 0, currently supports 0,1,2,3,4,5 six kinds of expressions

(3) Response data

{
  "code": 0, 
  "data": 123456, //Return the task ID after the task is submitted
  "msg": null, 
  "time": 1615368038661
}

Sample Code

curl -H 'APIKEY: INSERT_YOUR_API_KEY_HERE' \
  'https://www.cutout.pro/api/v1/faceDriven/submitTaskByUrl?imageUrl=xxxx&templateId=1' 
  import requests
  response = requests.get(
    'https://www.cutout.pro/api/v1/faceDriven/submitTaskByUrl?imageUrl=xxxx&templateId=1',
    headers={'APIKEY': 'INSERT_YOUR_API_KEY_HERE'},
  )
  $client = new GuzzleHttp\Client();
  $res = $client->get('https://www.cutout.pro/api/v1/faceDriven/submitTaskByUrl?imageUrl=xxxx&templateId=1', [
    'headers' => [
        'APIKEY' => 'INSERT_YOUR_API_KEY_HERE'
    ]
  ]);
  File file = new File("/Your/Image/File/Path");
  
  CloseableHttpClient client = HttpClients.createDefault();
  
  HttpGet httpGet = new HttpGet("https://www.cutout.pro/api/v1/faceDriven/submitTaskByUrl?imageUrl=xxxx&templateId=1");
  httpGet.setHeader("APIKEY", "INSERT_YOUR_API_KEY_HERE");

  try (CloseableHttpResponse response = client.execute(httpGet)){
    if (response.getStatusLine().getStatusCode() == HttpStatusCode.OK) {
        //todo your logic
    }
  } catch (IOException e) {
    e.printStackTrace();
  }
  var request = require('request');
  var fs = require('fs');

  request.get({
    url: 'https://www.cutout.pro/api/v1/faceDriven/submitTaskByUrl?imageUrl=xxxx&templateId=1',
    headers: {
    'APIKEY': 'INSERT_YOUR_API_KEY_HERE'
    },
    encoding: null
  }, function(error, response, body) {
    // console.log(response);
  });

Interface 2: Asynchronous notification

  • You need to provide an api address for receiving asynchronous notifications. The notification will be posted to the specified address in json format, json example:
{
  "eventName":"EVENT_FACE_DRIVEN_TASK_FINISHED",
  "eventData": {
    "taskId":123456,
    "resultUrl": "http://xxxxxxxxxxx", //Video address after video processing is completed
  }
}

Interface 3: Actively queried interface

(1) Request parameters (Header)

ParameterParameter TypeDescription
APIKEYstringYour API key

(2) Query String

ParameterParameter TypeDescription
taskIdtask IDtrue

(3) Response data

{ 
  "code": 0, 
  "data": {
    "taskId": 123456,
    "status": 1, //0: processing, 1: finished, 2: failed (it can be failed when there is no person detected)
    "resultUrl": "http://xxxxxxxxxxx.mp4", //Video address after video processing is completed
    "gifUrl": "http://xxxxxxxxxxx.gif" // If outputFormat is set to "gif", additional "gifUrl" field will be provided in response
  }, 
  "msg": null, 
  "time": 1615368038661 
}

Price

This interface call needs to consume video seconds. The video seconds corresponding to different templates are as follows:

Template idSeconds
03.13s
17.13s
22.13s
36.75s
44.38s
53.75s

Frequently asked questions

  • Q: What are the requirements for the input image format?
  • A: Support PNG, JPG, JPEG, BMP, WEBP
  • Q: Is there a limit to the supported image size?
  • A: The maximum resolution uploaded at present is 4096x4096 pixels, and the image file size is less than 15MB