Generate AI Avatar Videos
POST
/api/v1/video/generateQuality of the lip-sync: depending on whether you choose to “train a personalized avatar” (in the Add Avatar and Train Lip-sync section), the system will automatically apply either the universal lip-sync model or the dedicated trained lip-sync model for your avatar. If you skip “train a personalized avatar,” the lip-sync results for your avatar will be less realistic compared to using a dedicated lip-sync model trained with your avatar’s video.
Get the id of the avatar as "_id" returned by /api/v1/anchor/character_list.
Why is video generation sometimes slow? Please pay special attention to the parameter isSkipRs, which corresponds to Smart Motion Adjustment in the web UI. Enabling this option enhances the naturalness of the AI avatar’s movements. However, it can significantly slow down the generation process.
Request
The title of video
The "_id" returned from the api/v1/anchor/character_list. When you call character_list, remember to set user_video_twin_id and type.
Type of the avatar. 0 is system provided. 1 is user uploaded (custom)
ID of the system default background image. Do not set this value if you do not want to replace background.
ID of the custom background image. Do not set this value if you do not want to replace background
RGB format string of the color of the custom background image. e.g. rgb(133,137,132)
The url of the audio. Get the audio file url from send_tts method. Alternatively, Iif you provide your own audio. You can record the audio by yourself. You can obtain the audio from other TTS vendor such as ElevenLabs.
Resolution of the video
Width of the video. Simply set this to 0 if you do not need background matting (e.g. Neither back_id nor custom_back_id is not provide)
Height of the video. Simply set this to 0 if you do not need background matting (e.g. Neither back_id nor custom_back_id is not provide).
The placement of the avatar within the final image. Width of the avatar. Simply set this to 0 if you do not need background matting (e.g. Neither back_id nor custom_back_id is not provide)
The placement of the avatar within the final image. Height of the avatar. Simply set this to 0 if you do not need background matting (e.g. Neither back_id nor custom_back_id is not provide)
The placement of the avatar in the final video. The x value of the upper left corner of the avatar base,relative to the upper left corner of the video. Simply set this to 0 if you do not need background matting (e.g. Neither back_id nor custom_back_id is not provide)
The placement of the avatar in the final video. The y value of the upper left corner of the avatar base,relative to the upper left corner of the video.
Skip intelligent action adjustment (default true). If you turn this on, your video generation will be significantly slowed down.
The url of the original background image corresponding to the avatar, used to matting.
No need to set anchor_background_color if this value is given.
RGB format string of the original background color corresponding to the avatar, used to matting. e.g. rgb(0,255,0)
No need to set anchor_background_img if this value is given.
Allow Reverse. True is allow.
(Only useful for dedicated line users)
Whether to send your video generation request to the public computing power pool for inference, true means yes.
As a dedicated line user, there is no monthly video generation limit set by us. Your capacity is determined by how many videos your dedicated lines can process within a month. This endpoint allows you to send video generation requests to the public computing pool when your dedicated lines are occupied. For example, if you have two dedicated lines but three video generation requests are created simultaneously, the third request would typically wait until one of the lines becomes available. However, if you choose to utilize the public pool, all three requests can be processed concurrently, ensuring faster results and increased efficiency.
The requests sent to the public computing pool will consume your coins as regular user's requests. The purpose of sending your requests to the public computing pool is to accelerate the process of your video generation by using more computing resources. But this will increase your cost (you need to prepare enough coins).
Whether to enable captions, true means enabled.
This is the font style, which is only effective when isCaptionEnabled equals true.
Caption Language.
RGBA format string of the font primary colour.
Font name,
Currently supported fonts are Arial, AaYuanWeiTuSi, AaFengKuangYuanShiRen, Aozora Mincho, SJbangkaijianti, 337-SSHuaGuangTi, YEFONTZhaoPaiTi, ziticqnananti, ZXFMingKeBen, TangXianBinSong, Luoguocheng-maobixiaoxiankaijia, Kingnamype Yuanmo SC, JMH, huangkaihuaLawyerfont.
Font Size.
Border Style.
Subtitle Position,It represents the percentage distance of the font from the bottom of the video, displayed in center alignment.
RGBA format string of the font outline colour.
RGBA format string of the font back colour.
{
"title": "My first AI video",
"anchor_id": "660556b3cd492168141926d3",
"anchor_type": 1,
"back_id": "62a6d3e56c209514b155b12b",
"audioSrc": "https://speech_cdn.ai-anchor.com/dubbing_stable/pyK1dvqcDKpKJo1IcEPm_9714_fr.mp3",
"resolution": 1080,
"web_bg_width": 853,
"web_bg_height": 480,
"web_people_width": 270,
"web_people_height": 480,
"web_people_x": 292,
"web_people_y": 0,
"isSkipRs": true,
"isCaptionEnabled": true,
"captionAlign": {
"language": "en-US",
"PrimaryColour": "rgba(247, 89, 171, 1)",
"OutlineColour": "rgba(0, 0, 0, 1)",
"BorderStyle": 4,
"BackColour": "rgba(146, 84, 222, 1)",
"FontName": "AaFengKuangYuanShiRen",
"Fontsize": 50,
"subtitle_position": 0.3
}
}
Request samples
Responses
The id of the video. e.g. 652d00b8a71c91a83bba6195
{
"code": 0,
"data": {
"title": "202404071749",
"msg": "",
"algo_result": "",
"result": "",
"retry": 0,
"process": 0,
"isDel": false,
"isSkipRs": false,
"status": "start",
"error": "",
"anchor_type": "1",
"resolution": "1080",
"voice_type": "0",
"audioSrc": "https://dh24as48lv9ce.cloudfront.net/ai/speech/tts/azure_service/azure_synth.-8161556380964742732.wav",
"custom_voice": "",
"priority": 4,
"restart_date": null,
"audioLen": 5,
"web_people_width": 608,
"web_people_height": 1080,
"web_people_x": 657,
"web_people_y": 0,
"web_bg_width": 1920,
"web_bg_height": 1080,
"color": "",
"result_cover": "",
"wl_model": "WLGPNormal",
"anchor_background_img": "",
"anchor_background_color": "",
"_id": "6613b4c216004c1df435d6ff",
"user_id": "637498294abbb165572d5dbe",
"anchor_id": "660556b3cd492168141926d3",
"web_dist_bg_width": -2,
"web_dist_bg_height": -2,
"web_dist_bg_x": 0,
"web_dist_bg_y": 0,
"replace_bg_id": "62a6d3e56c209514b155b12b",
"version": 1,
"createdAt": "2024-04-08T09:11:30.329Z",
"updatedAt": "2024-04-08T09:11:30.329Z",
"__v": 0
}
}