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);
}
})();
Input Image.
Number of frames per second
min : 1,
max : 60
to control the motion of the generated video
min : 1,
max : 180
Seed for video generation.
min : -1,
max : 999999999999999
noise added to the conditioning image
min : 0,
max : 1
No of frames in output video
Decides the output video dimensions
Allowed values:
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) 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.