- GET START
- OpenAI Compatiable Endpoint
- Audio
- Anthropic Compatiable Endpoint
- Music Generation Endpoint
- Image Generation Endpoint
- Video Generation Ednpoint
- runway(video)
- PIKA(video)
- luma (video)
- kling (video)
- MiniMax Conch(video)
- Software Integration Guide
- cometapi Site API Call Testing
- OpenManus
- Chatbox
- CherryStudio
- Cursor
- ChatHub
- cline
- dify
- gptme
- Immersive Translation
- Lobe-Chat
- Zotero
- LangChain
- AnythingLLM
- Eudic Translation
- OpenAI Translator
- ChatAll Translation
- Pot Translation
- GPT Academic Optimization (gpt_academic)
- NEXT CHAT (ChatGPT Next Web)
- Obsidian's Text Generator Plugin
- Open WebUI
- avante.nvim
- librechat
- Lazy Customer Service
- utools-ChatGPT Friend
- IntelliJ Translation Plugin
- n8n
Image Generation Video
POST
https://api.cometapi.com/kling/v1/videos/image2video
Maintainer:Not configured
Request
Header Params
Authorization
string
required
Example:
Bearer {{api-key}}
Body Params application/json
model_name
string
optional
image
string
required
image_tail
string
optional
prompt
string
optional
negative_prompt
string
optional
cfg_scale
number
optional
mode
string
optional
static_mask
string
optional
The “Motion Brush” capability includes both “dynamic_masks” and “static_masks”.
● Support for passing in image Base64 encoding or image URLs (to ensure accessibility, formatting requirements are the same as for the image field).
● Support .jpg / .jpeg / .png image format.
● The image aspect ratio must be the same as the input image (i.e. image field), otherwise the task fails.
static_mask and dynamic_masks.mask must have the same resolution or the task fails (FAILED)
dynamic_masks
object
optional
Multiple groups (up to 6) can be configured, each containing a sequence of “paint area masks” and “motion trajectories”.
mask
string
optional
● Support for passing in image Base64 encoding or image URLs (to ensure accessibility, formatting requirements are the same as for the image field)
● Image format support for .jpg / .jpeg / .png
● The image aspect ratio must be the same as the input image (i.e. image field) or the task will fail (FAILED).
static_mask and dynamic_masks.mask must have the same resolution or the task fails (FAILED)
trajectories
object
optional
● Generate a 5s video, the length of the trajectory does not exceed 77, i.e., the number of coordinates takes the range of [2, 77].
● Trajectory coordinate system, take the bottom left corner of the picture as the coordinate origin.
Note 1: The more the number of coordinate points, the more accurate the trajectory portrayal, if there are only 2 trajectory points, then it will be a straight line connecting these two points.
Note 2: The direction of the trajectory is pointed by the incoming order, the first incoming coordinate is the starting point of the trajectory, and the subsequent coordinates are linked to form the trajectory.
duration
string
optional
callback_url
string
optional
external_task_id
string
optional
● User-defined task ID, passed in will not overwrite the system-generated task ID, but support task query by this ID
● Please note that uniqueness needs to be guaranteed under single user.
Example
{
"model_name": "kling-v1",
"mode": "pro",
"duration": "5",
"image": "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg",
"prompt": "The astronauts got up and left.",
"cfg_scale": 0.5,
"static_mask": "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png",
"dynamic_masks": [
{
"mask": "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png",
"trajectories": [
{
"x": 279,
"y": 219
},
{
"x": 417,
"y": 65
}
]
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.cometapi.com/kling/v1/videos/image2video' \
--header 'Authorization: Bearer {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model_name": "kling-v1",
"mode": "pro",
"duration": "5",
"image": "https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg",
"prompt": "The astronauts got up and left.",
"cfg_scale": 0.5,
"static_mask": "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888177/cOLNrShrSO/static_mask.png",
"dynamic_masks": [
{
"mask": "https://h2.inkwai.com/bs2/upload-ylab-stunt/ai_portal/1732888130/WU8spl23dA/dynamic_mask_1.png",
"trajectories": [
{
"x": 279,
"y": 219
},
{
"x": 417,
"y": 65
}
]
}
]
}'
Responses
🟢200Successful Response
application/json
Body
code
integer
required
message
string
required
request_id
string
required
data
object
required
task_id
string
required
task_status
string
required
task_status_msg
string
required
task_info
object
required
task_result
object
required
created_at
integer
required
updated_at
integer
required
Example
{
"code": 0,
"message": "string",
"request_id": "string",
"data":{
"task_id": "string",
"task_status": "string",
"task_status_msg": "string",
"task_info": {
"external_task_id": "string"
},
"task_result":{
"videos":[
{
"id": "string",
"url": "string",
"duration": "string"
}
]
}
"created_at": 1722769557708,
"updated_at": 1722769557708,
}
}