Stable Video Diffusion

Takes image as input and returns a video.

~29.75s
~$0.167
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/svd"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://segmind-sd-models.s3.amazonaws.com/outputs/svd_input.png",
12    "fps": 7,
13    "motion": 127,
14    "seed": 452361789,
15    "cond_aug": 0.1,
16    "frames": "14",
17    "resize_method": "maintain_aspect_ratio",
18    "base64": false
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24    result = response.json()
25    print(json.dumps(result, indent=2))
26else:
27    print(f"Error: {response.status_code}")
28    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/svd

Parameters

imagerequired
string (uri)

Input Image.

base64optional
boolean

Base64 encoding of the output video.

Default: false
cond_augoptional
number

noise added to the conditioning image

Default: 0.2Range: 0 - 1
fpsoptional
integer

Number of frames per second

Default: 7Range: 1 - 60
framesoptional
integer

No of frames in output video

Default: 14
Allowed values :
1425
motionoptional
integer

to control the motion of the generated video

Default: 127Range: 1 - 180
resize_methodoptional
string

Decides the output video dimensions

Default: "maintain_aspect_ratio"
Allowed values :
"maintain_aspect_ratio""crop_to_16_9"
seedoptional
integer

Seed for video generation.

Default: -1Range: -1 - 999999999999999

Response Type

Returns: Video

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out