POST
javascript
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); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


input_imageimage *

URL of the input image


promptstr *

Text prompt describing the desired video


negative_promptstr ( default: 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. )

Negative prompt to exclude specific details


video_lengthint ( default: 72 )

Length of the generated video in seconds

min : 40,

max : 136


seedint ( default: 43 )

Seed for random number generation


stepsint ( default: 25 )

Number of inference steps for generating the video

min : 20,

max : 50


cfgfloat ( default: 7 )

Classifier-Free Guidance scale

min : 4,

max : 15


schedulerenum:str ( default: Euler )

Scheduler for the video generation process

Allowed values:


frame_ratefloat ( default: 24 )

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

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).

Steps to Generate a Video with Easy Animate

  1. 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.

  • Example: “A scene of a beautiful woman at a night party, with high-quality, clear visuals, ultra-detailed settings, and fantastic lighting.”
  1. 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.

  2. 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.

  3. Negative Prompt: In the "Negative Prompt" box, specify what you don’t want in the video.

  4. Video Length: Enter the desired number of frames for the video. Remember the maximum allowed is 136 frames.

  5. 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.

  1. 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.

  2. 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.

Applications of Easy Animate

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.