1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const axios = require('axios');
const fs = require('fs');
const path = require('path');
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/easy-animate";
const data = {
"input_image": "toB64('https://segmind-sd-models.s3.amazonaws.com/display_images/easy-animate/easy-animate-ip.png')",
"prompt": "photo of a beautiful woman in a night party. The video is of high quality, and the view is very clear. High quality, masterpiece, best quality, highres, ultra-detailed, fantastic",
"negative_prompt": "The video is not of a high quality, it has a low resolution, and the audio quality is not clear. Strange motion trajectory, a poor composition and deformed video, low resolution, duplicate and ugly, strange body structure, long and strange neck, bad teeth, bad eyes, bad limbs, bad hands, rotating camera, blurry camera, shaking camera. Deformation, low-resolution, blurry, ugly, distortion.",
"video_length": 72,
"seed": 43,
"steps": 25,
"cfg": 7,
"scheduler": "Euler",
"frame_rate": 24
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
URL of the input image
Text prompt describing the desired video
Negative prompt to exclude specific details
Length of the generated video in seconds
min : 40,
max : 136
Seed for random number generation
Number of inference steps for generating the video
min : 20,
max : 50
Classifier-Free Guidance scale
min : 4,
max : 15
Scheduler for the video generation process
Allowed values:
Frame rate of the generated video
min : 20,
max : 27
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Easy Animate is a state-of-the-art animation toolkit developed by the team at Alibaba PAI. The model leverages advanced deep learning frameworks to convert static images into dynamic animations with remarkable accuracy and fluidity. Easy Animate utilizes a convolutional neural network (CNN) based architecture intertwined with temporal coherence algorithms to ensure realistic and natural movement between frames.
Architecture: Easy Animate is built upon the transformer architecture, which has proven effective for various natural language processing and computer vision tasks.
Purpose: It serves as an end-to-end solution for video generation, making it suitable for applications such as video synthesis, style transfer, and creative content production.
Components: Easy Animate integrates motion modules, u-vit (a variant of the Vision Transformer), and slice-vae (for processing long videos).
Prompt: Enter a detailed description of the video you want to generate in the "Prompt" box. This should include specifics about the scene, characters, actions, and desired quality.
Input Image: Upload an image that the AI can use as a reference for generating the video. You can do this by clicking on the "Click or Drag n Drop" area and selecting the appropriate image from your files.
Seed:
If you want consistent results for repeated attempts, enter a specific seed value.
If you want to explore different possibilities, check the "Randomise Seed" box to get varying results each time.
Negative Prompt: In the "Negative Prompt" box, specify what you don’t want in the video.
Video Length: Enter the desired number of frames for the video. Remember the maximum allowed is 136 frames.
CFG Scale:
Set the CFG (Classifier-Free Guidance) scale to direct how closely the generation should follow the prompt and image reference.
Example: Enter “7” for a balanced influence.
Scheduler: Choose a scheduler type like “Euler” which might affect how the inference process is handled. Different schedulers can produce different visual styles in your video.
Frame Rate:
Enter the frames per second (fps) for your video. Remember the maximum allowed is 27 fps.
Example: Enter “24” for a smoothly animated result.
Easy Animate finds applications in various domains:
Content Creation: Content creators can use Easy Animate to produce engaging videos for social media, marketing campaigns, or educational purposes.
Artistic Expression: Artists and designers can explore style transfer and create visually appealing animations.
Research and Development: Researchers can leverage Easy Animate for experiments related to video synthesis and generative models.