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 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/svd"; const data = { "image": toB64('https://segmind-sd-models.s3.amazonaws.com/outputs/svd_input.png'), "fps": 7, "motion": 127, "seed": 452361789, "cond_aug": 0.1, "frames": 14, "resize_method": "maintain_aspect_ratio", "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


imageimage *

Input Image.


fpsint ( default: 7 ) Affects Pricing

Number of frames per second

min : 1,

max : 60


motionint ( default: 127 ) Affects Pricing

to control the motion of the generated video

min : 1,

max : 180


seedint ( default: -1 )

Seed for video generation.

min : -1,

max : 999999999999999


cond_augfloat ( default: 0.2 )

noise added to the conditioning image

min : 0,

max : 1


framesstr ( default: 14 )

No of frames in output video


resize_methodenum:str ( default: maintain_aspect_ratio )

Decides the output video dimensions

Allowed values:


base64boolean ( default: 1 )

Base64 encoding of the output video.

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.

Stable Diffusion Video (SVD)

Stable Diffusion Video (SVD) represents a significant advancement in the field of AI-driven video generation. SVD enables the creation of high-quality video content through a process known as latent diffusion. This is done by mapping video frames into a latent space where complex patterns and structures can be analyzed and manipulated with unprecedented precision.

At its core, SVD utilizes a deep neural network trained on vast datasets to understand and replicate the nuances of video dynamics. The model’s ability to interpolate between frames results in smooth transitions and realistic motion, even in scenarios where input data is sparse. This makes SVD particularly adept at tasks such as video upscaling, frame rate conversion, and even generating new content based on textual descriptions.

One of the standout features of SVD is its efficiency. By optimizing the diffusion process, SVD reduces the computational load typically associated with video generation. This opens up new possibilities for creators who can now produce high-fidelity videos without the need for extensive hardware resources.