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 34 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/motionctrl-svd"; const data = { "input_image": toB64('https://segmind-sd-models.s3.amazonaws.com/display_images/motion-control-svd/motionctrl_ip.png'), "fps": 7, "motion": "CW", "motion_bucket_id": 127, "cond_aug": 0.02, "seed": 985445, "decoding_t": 1, "maintain_aspect_ratio": true, "motion_speed": 1, "base64": false }; (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 *

Input image


fpsint *

Frames per second for the video

min : 5,

max : 30


motionenum:str *

Motion type

Allowed values:


motion_bucket_idint *

Motion bucket ID

min : 127,

max : 255


cond_augfloat *

Conditional augmentation

min : 0,

max : 1


seedint ( default: 985445 )

Seed for random number generation


decoding_tint ( default: 1 )

Decoding time


maintain_aspect_ratiobool ( default: true )

Maintain aspect ratio


motion_speedfloat ( default: 1 )

Speed of the motion

min : 0,

max : 10


base64boolean ( default: 1 )

Base64 encoding of the output image.

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.

Motion Control SVD

The Motion Control SVD is a sophisticated deep learning framework developed to generate motion-controlled animations from static images. By leveraging cutting-edge neural network techniques, this model transforms static imagery into dynamic motions, allowing precise control over various parameters to achieve the desired animation effects. Motion Control SVD effectively and independently manages both camera motion and object motion. Existing methods either focus on one type of motion or do not distinguish between the two, limiting their control and diversity. The models architecture and training strategy are designed to address the unique properties of camera and object motion.

How to Use Motion Control SVD?

  1. Input Image: Upload the static image (PNG, JPG, or GIF) that you want to animate.

  2. FPS: Set the frames per second (FPS) to determine the smoothness of the animation.

  3. Motion: Select the type of motion (e.g., up, down, left, right, zoom in, zoom out etc).

  4. Seed: Input a seed value for reproducibility or randomize the seed.

  5. Generate: Click on the "Generate" button to create the animated image.

How to Fine-Tune Video Outputs with Motion Control SVD?

The model offers several parameters that can be fine-tuned to achieve specific animation effects:

  • Motion Bucket ID: This parameter helps control the motion style. Higher values typically result in more complex motion patterns.

  • Conditional Augmentation (Aug): Set this value to introduce variations based on conditional inputs. Higher values make the model more sensitive to input variations, producing diverse animations.

  • Decoding Time: This setting defines the time required for motion decoding. Longer decoding times result in smoother animations but require more computational resources.

  • Maintaining Aspect Ratio: Enable this option to preserve the original aspect ratio of the image, avoiding any distortion during animation.

  • Motion Speed: Adjust this value to control the speed of the motion. Higher values lead to faster animations, while lower values produce slower, more nuanced motion.

Use Cases

  • Entertainment and Media: Enhancing motion graphics, creating lively animations for characters, and generating dynamic visual effects for video content.

  • Advertising: Producing eye-catching animations for digital advertisements and promotional material.

  • Education: Developing illustrative animations for educational content, making learning interactive and engaging.

  • Social Media: Creating unique and engaging visual content to enhance social media presence and attract followers.