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",
  "image": "<string>",
  "image_tail": "<string>",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "cfg_scale": 0.5,
  "mode": "std",
  "static_mask": "<string>",
  "dynamic_masks": [
    {
      "mask": "<string>",
      "trajectories": [
        {
          "x": 123,
          "y": 123
        }
      ]
    }
  ],
  "camera_control": {
    "type": "simple",
    "config": {
      "horizontal": 0,
      "vertical": 0,
      "pan": 0,
      "tilt": 0,
      "roll": 0,
      "zoom": 0
    }
  },
  "duration": "5"
}
'
{
  "task_info": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "pending",
    "created_at": "2025-09-21T00:00:00.000Z",
    "updated_at": "2025-09-21T00:00:00.000Z",
    "error": {
      "code": 3001,
      "title": "Task Execution Error",
      "detail": "Task execution failed"
    }
  }
}
Most of the parameters of this API are compatible with Kling’s format. Please refer to Kling’s official documentation for more details.

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

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 Notice: This parameter is not supported by Kling v2.1 models. 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

Positive text prompt. Cannot exceed 2500 characters.

Maximum string length: 2500
negative_prompt
string

Negative text prompt. Cannot exceed 2500 characters.

Maximum string length: 2500
cfg_scale
number<float>
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
  • 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 array 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

202 - application/json

Message object.

task_info
object