Skip to main content
POST
/
video
/
img2video
Generate video from image
curl --request POST \
  --url https://modelslab.com/api/v6/video/img2video \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "model_id": "svd",
  "init_image": "<string>",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "height": 123,
  "width": 123,
  "num_frames": 16,
  "num_inference_steps": 20,
  "min_guidance_scale": 1,
  "max_guidance_scale": 3,
  "motion_bucket_id": 127,
  "noise_aug_strength": 0.5,
  "fps": 15,
  "output_type": "mp4",
  "temp": false,
  "webhook": "<string>",
  "track_id": "<string>"
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "future_links": [
    "<string>"
  ],
  "meta": {},
  "eta": 123,
  "message": "<string>",
  "tip": "<string>",
  "fetch_result": "<string>"
}

Image to Video

Generate videos from images. Image to Video Example

Request

Make a POST request to below endpoint and pass the required parameters in the request body.
curl
--request POST 'https://modelslab.com/api/v6/video/img2video' \

Body

json
{
    "key":"",
    "model_id":"svd",
    "init_image": "https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/e2f9cb8e-cb87-4143-dd81-a9e77e3bb800/768",
    "height":512,
    "width":512,
    "num_frames":25,
    "num_inference_steps":20,
    "min_guidance_scale":1,
    "max_guidance_scale":3,
    "motion_bucket_id":20,
    "noise_aug_strength":0.02,
    "webhook":null,
    "track_id":null
}

Body

application/json
key
string
required

Your API Key used for request authorization

model_id
enum<string>
required

The ID of the model to use

Available options:
svd
init_image
string<uri>
required

URL of the initial image

prompt
string

Text prompt describing desired video elements

negative_prompt
string

Items you don't want in the video

height
integer

Height in pixels

Required range: x <= 512
width
integer

Width in pixels

Required range: x <= 512
num_frames
integer
default:16

Number of frames

Required range: x <= 25
num_inference_steps
integer
default:20

Number of denoising steps

Required range: x <= 50
min_guidance_scale
number
default:1

Start value of guidance scale

Required range: 1 <= x <= 8
max_guidance_scale
number
default:3

End value of guidance scale

Required range: 1 <= x <= 8
motion_bucket_id
integer
default:127

Motion control parameter

noise_aug_strength
number

Noise augmentation strength

Required range: 0 <= x <= 1
fps
integer

Frames per second

Required range: x <= 16
output_type
enum<string>

Output format

Available options:
mp4,
gif
temp
boolean
default:false

Store in temporary storage

webhook
string<uri>

Webhook URL

track_id
string

Tracking ID

Response

Image-to-video generation response

status
enum<string>

Status of the video generation

Available options:
success,
processing,
error
generationTime
number

Time taken to generate the video in seconds

id
integer

Unique identifier for the video generation

output
string<uri>[]

Array of generated video URLs

Array of proxy video URLs

Array of future video URLs for queued requests

meta
object

Metadata about the video generation including all parameters used

eta
integer

Estimated time for completion in seconds (processing status)

message
string

Status message or additional information

tip
string

Additional information or tips for the user

fetch_result
string<uri>

URL to fetch the result when processing

I