Skip to main content
POST
/
vendors
/
kling
/
v1
/
videos
/
image2video
Image to Video
curl --request POST \
  --url https://api.mulerun.com/vendors/kling/v1/videos/image2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model_name": "kling-v2-1-master",
  "mode": "pro",
  "duration": "5",
  "image": "https://upload.wikimedia.org/wikipedia/commons/1/11/North_Lake_Tahoe_Aerial_photo_Don_Ramey_Logan.jpg",
  "prompt": "A bird is flying over the lake",
  "cfg_scale": 0.5
}'
{
  "videos": [
    "https://example.com/1234567890.mp4"
  ],
  "task_info": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "succeeded",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}
This API is compatible with Kling’s format.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model_name
enum<string>
default:kling-v2-1-master

Model Name

Available options:
kling-v2-1-master
image
string

Reference Image. Support inputting image Base64 encoding or image URL (ensure accessibility).

Important: When using Base64 encoding, do not add any prefixes such as data:image/png;base64,. Provide only the Base64-encoded string itself.

  • Supported image formats: .jpg, .jpeg, .png
  • Image file size cannot exceed 10MB
  • Width and height dimensions must not be less than 300px
  • Aspect ratio should be between 1:2.5 ~ 2.5:1
  • At least one parameter should be filled in between image and image_tail
  • image+image_tail, dynamic_masks/static_mask, and camera_control cannot be used at the same time
image_tail
string | null

Reference Image - End frame control. Support inputting image Base64 encoding or image URL (ensure accessibility).

Important: When using Base64 encoding, do not add any prefixes such as data:image/png;base64,. Provide only the Base64-encoded string itself.

  • Supported image formats: .jpg, .jpeg, .png
  • Image file size cannot exceed 10MB
  • Width and height dimensions must not be less than 300px
  • At least one parameter should be filled in between image and image_tail
  • image+image_tail, dynamic_masks/static_mask, and camera_control cannot be used at the same time
prompt
string | null

Positive text prompt. Cannot exceed 2500 characters.

Maximum length: 2500
negative_prompt
string | null

Negative text prompt. Cannot exceed 2500 characters.

Maximum length: 2500
cfg_scale
number
default:0.5

Flexibility in video generation. Higher value means lower flexibility and stronger relevance to the prompt. Range [0, 1].

Required range: 0 <= x <= 1
mode
enum<string>
default:std

Video generation mode

std: Standard Mode, which is cost-effective. pro: Professional Mode, generates videos use longer duration but higher quality video output.

Available options:
std,
pro
static_mask
string | null

Static Brush Application Area (Mask image created by users using the motion brush).

The "Motion Brush" feature includes two types of brushes: Dynamic Brush (dynamic_masks) and Static Brush (static_mask).

  • Support inputting image Base64 encoding or image URL
  • Supported image formats: .jpg, .jpeg, .png
  • The aspect ratio of the mask image must match the input image; otherwise, the task will fail
  • The resolutions of the static_mask image and the dynamic_masks.mask image must be identical
dynamic_masks
object[] | null

Dynamic Brush Configuration List. Multiple configurations can be set up (up to 6 groups). Each group includes a "mask area" (mask) and a sequence of "motion trajectories" (trajectories).

Maximum length: 6
camera_control
object

Terms of controlling camera movement. If not specified, the model will intelligently match based on the input text/images.

duration
enum<string>
default:5

Video Length in seconds

Available options:
5,
10

Response

200 - application/json

Message object.

videos
string<uri>[]

URL of the generated video

Example:
["https://example.com/1234567890.mp4"]
task_info
object
I