Overview of the Image Animation API in the Stable Video Diffusion AI.
The Stable Video Diffusion AI excels in bringing still images to life, transforming them into brief animated clips where recognizable elements are set in motion. For those looking to incorporate this feature into their own software or app, the Yes Ai API offers a seamless integration solution. We advise trying out the image animation functionality via our Telegram bot @yes_ai_bot before full integration.
Guidelines for Uploading a Fresh Image Animation Request through the Yes Ai API
POST https://api .yesai.su/v2/yesvideo/aniphoto/svd
headers: { Content-Type: application/json, Authorization: Bearer <token> }
Example API request for submitting a Stable Video Diffusion job
curl -X POST https://api.yesai.su/v2/yesvideo/aniphoto/svd
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"
-d '{
"photo_url": "https://yoururl.com/image1.jpeg",
}'Parameters:
photo_url = '...' (required, link to photo)
List of possible errors:
['success' => false, 'message' => 'PHOTO_URL_IS_EMPTY'], 400
['success' => false, 'message' => 'PHOTO_URL_NOT_VALID'], 400
['success' => false, 'message' => 'PHOTO_FILE_SIZE_NOT_VALID'], 400
['success' => false, 'message' => 'PHOTO_MIME_TYPE_NOT_VALID'], 400
['success' => false, 'message' => 'UNAUTHORIZED'], 401
['success' => false, 'message' => 'PHOTO_NOT_FOUND'], 404
['success' => false, 'message' => 'NOT_ENOUGH_RPOINTS'], 409
['success' => false, 'message' => 'TASK_LIMIT_EXCEEDED'], 409
['success' => false, 'message' => 'TOO_MANY_REQUESTS'], 429
['success' => false, 'message' => 'INTERNAL_SERVER_ERROR'], 500
When your new task is successfully submitted, you will receive the following response format:
['success' => true, 'message' => 'OK', 'results' => ['animation_data' => [ ... ]]], 200
You will also be provided with a distinctive “id” number that will be essential for future inquiries regarding the status of your task completion.
How to verify the progress status of a specific task using its identification number
GET https:/ /api.yesai.su/v2/yesvideo/animations/{id}
headers: { Content-Type: application/json, Authorization: Bearer <token> }
An example of a request to obtain the execution status of one Stable Video Diffusion job
curl -X GET https://api.yesai.su/v2/yesvideo/animations/{id}
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"Parameters:
{id} = 12345 (required, task id)
Possible errors:
['success' => false, 'message' => 'ID_IS_EMPTY'], 400
['success' => false, 'message' => 'ID_NOT_VALID'], 400
['success' => false, 'message' => 'ID_NOT_FOUND'], 404
['success' => false, 'message' => 'UNAUTHORIZED'], 401
['success' => false, 'message' => 'TOO_MANY_REQUESTS'], 429
['success' => false, 'message' => 'INTERNAL_SERVER_ERROR'], 500
Format for confirming successful verification of task completion status:
['success' => true, 'message' => 'OK', 'results' => ['animation_data' => [ ... ]]], 200
Potential status codes:
"status": 0 ("status_description":"waiting in line") - the task is awaiting processing (patience is required)
"status": 1 ("status_description":"currently processing") - the task is actively being worked on (patience is still needed)
"status": 2 ("status_description":"finished successfully") - the task has been finished with success (the outcome is ready for review)
"status": 3 ("status_description":"error led to rejection") - the task was declined due to an error (the error specifics can be found in the “comment_ru” and “comment_en” sections)
"status": 4 ("status_description":"rejected on account of delay") - the task was dismissed due to a delay (the task should be submitted again)
Monitoring the Progress of a Batch of Recent Assignments
When overseeing multiple assignments collectively, this approach is ideal. You will receive an array detailing the status of the latest 20 assignments based on the criteria you've chosen.
Absent a status-specific filter in the request, the endpoint will provide an enumeration of the 20 latest assignments.
GET https ://api.yesai.su/v2/yesvideo/animations?type=4&status={status}
headers: { Content-Type: application/json, Authorization: Bearer <token> }
An example of a request to get the execution status of the latest Stable Video Diffusion jobs
curl -X GET https://api.yesai.su/v2/yesvideo/animations?type=4&status={status}
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"Parameters:
{status} = 2 (required, task status. It is allowed to list several types of statuses in one request, separated by commas, for example: status=1,2,3)
{type} = 4 (required, service type Stable Video Diffusion)
The {status} parameter can take the following values:
0 - Queue of pending tasks awaiting execution
1 - Inventory of tasks currently in progress
2 - Record of tasks that have been successfully completed
3 - Catalog of tasks that have been declined by the system
4 - Roster of jobs that have been dismissed due to exceeding the time limit
Possible errors:
['success' => false, 'message' => 'TYPE_IS_EMPTY'], 400
['success' => false, 'message' => 'TYPE_NOT_VALID'], 400
['success' => false, 'message' => 'TYPES_NOT_VALID'], 400
['success' => false, 'message' => 'STATUS_IS_EMPTY'], 400
['success' => false, 'message' => 'STATUS_NOT_VALID'], 400
['success' => false, 'message' => 'LIMIT_OFFSET_IS_EMPTY'], 400
['success' => false, 'message' => 'LIMIT_OFFSET_NOT_VALID'], 400
['success' => false, 'message' => 'LIMIT_COUNT_IS_EMPTY'], 400
['success' => false, 'message' => 'LIMIT_COUNT_NOT_VALID'], 400
['success' => false, 'message' => 'SORT_FIELD_IS_EMPTY'], 400
['success' => false, 'message' => 'SORT_FIELD_NOT_VALID'], 400
['success' => false, 'message' => 'SORT_ORDER_IS_EMPTY'], 400
['success' => false, 'message' => 'SORT_ORDER_NOT_VALID'], 400
['success' => false, 'message' => 'DATA_TYPE_IS_EMPTY'], 400
['success' => false, 'message' => 'DATA_TYPE_NOT_VALID'], 400
['success' => false, 'message' => 'ID_OFFSET_IS_EMPTY'], 400
['success' => false, 'message' => 'ID_OFFSET_NOT_VALID'], 400
['success' => false, 'message' => 'UNAUTHORIZED'], 401
['success' => false, 'message' => 'TOO_MANY_REQUESTS'], 429
['success' => false, 'message' => 'INTERNAL_SERVER_ERROR'], 500
Illustration of a JSON formatted API reply for a job status inquiry
Example API response when requesting the status of a Stable Video Diffusion job
{
"success": true, // data received successfully
"message": "OK",
"results": {
"animation_data": {
"id": 1, // unique task ID in the Yes Ai system
"user_id": 1, // ID of the user who submitted the task
"tariff_id": 30, // user tariff plan (0 - Demo, 5 - Micro, 10 - Start, 20 - Standard, 30 - VIP)
"type": 4, // type of task completed, 4 - Stable Video Diffusion
"photo_url": "https://yourdomain.com/image1.jpeg", // link with source image for animation
"audio_url": "", // in this type of task the variable is not used
"video_url": "", // in this type of task the variable is not used
"result_url": "https://yesai.su/files/video/1_1234567890.mp4", // the result of the task is in MP4 format, you need to download it to your server
"result_type": "video", // the file type for the completed job, for Stable Video Diffusion it is always 'video'
"result_data": {
"video_width": 768, // width of the video in pixels that is the result of the job
"video_height": 768, // height of the video in pixels that is the result of the job
"video_duration": 3, // video duration in seconds
"video_durrange": 0, // variable is not used in this job type
"video_fps": 40 // number of frames per second
},
"comment_ru": "", // comment for the task in Russian, it is filled in only if the task could not be completed
"comment_en": "", // comment for the task in English, it is filled in only if the task could not be completed
"accounting": {
"total_cost": 35.094528, // total cost of completing the task in conventional units
"spent_points": 0, // the number of ⭐️points that were removed from the balance for completing the task. For Stable Video Diffusion, the field will always be 0, because payment is made in 🔅 coins
"spent_rpoints": 35.094528, // the number of 🔅coins that were withdrawn from the balance for completing the task
"spent_repost_points": 0, // the number of bonus points for reposts that were deducted for completing the task. For Stable Video Diffusion, the field will always be 0, because payment is made in 🔅 coins
"spent_balance": 0, // the amount of money from the main balance that was withdrawn for completing the task. For Stable Video Diffusion, the field will always be 0, because payment is made in 🔅 coins
"spent_rbalance": 0, // the amount of money from the bonus balance that was withdrawn for completing the task. For Stable Video Diffusion, the field will always be 0, because payment is made in 🔅 coins
"remaining_points": 820, // remaining balance ⭐️points after completing the task
"remaining_rpoints": 3739.2603184, // balance on balance 🔅coins after completing the task
"remaining_repost_points": 0, // the balance of points on the balance of reposts after completing the task
"remaining_balance": 0, // balance on the main balance after completing the task
"remaining_rbalance": 3341.37 // balance in the bonus balance after completing the task
},
"language": "", // variable is not used for Stable Video Diffusion
"prompt": "", // variable is not used for Stable Video Diffusion
"status": 2, // task status, where 2 is successful completion
"status_description": "completed", // text explanation of the task status, where completed means successful completion
"start_at": 1711501452, // unixtime, task start time
"finish_at": 1711501554, // unixtime, task completion time
"created_at": 1711501412, // unixtime, client submission time
"updated_at": 1711501554 // unixtime, time of last job status update
}
}
}The sequence in which finished tasks for image animation, specifically using Stable Video Diffusion, are handled when submitted via the Yes Ai API.
Upon successful completion of the image animation project, a distinctive link for downloading the video in "MP4" format will be provided to you. This video will be accessible on our server for a duration of 60 minutes. It is imperative that you promptly download the finished product to your server following the task's conclusion.
Guidelines for Task Submission and Status Monitoring
You have the ability to generate assignments in Yes Ai through the API and monitor their progress by adhering to specific guidelines.
Criteria for images uploaded with new task submissions:
The maximum file size for animation images is 5MB.
Permitted image file types include jpeg, jpg, and png.
Issuing POST requests to initiate new assignments via the API:
New tasks can be submitted at a frequency of no more than once every second.
Limit on the total number of tasks in the Yes Ai processing queue (this queue is shared among all job types submitted through the Yes Ai API):
The queue can hold a maximum of 8 tasks at any given time.
Should your service generate tasks at a higher frequency, it is recommended to manage an independent job queue.
Dispatching GET requests to retrieve the completion status of tasks that have been previously submitted:
Status inquiries should be made at intervals of no less than one second.
For any inquiries regarding the use of the Yes Ai API, please reach out to the official support team through the Telegram messenger at @yes_ai_support.
.jpeg)