API Doc-CometAPI
HomeDashBoardModel_Price
HomeDashBoardModel_Price
Discord_Support
  1. kling (video)
  • GET START
    • Model New Release Announcement
    • Platform notification
    • Help Center
    • Quick Start
    • About Pricing
    • About Grouping
    • Interface Stability
    • Privacy policy
    • Terms of service
    • Error code description
    • Code example
    • Must see for use
    • Common Misconceptions
    • Confusion about use
    • Best Practices
      • CometAPI Account Balance Query API Usage Instructions
      • Retry Logic Documentation for CometAPI and OpenAI Official API
      • Midjourney Best Practices
      • Runway Best Practices
  • OpenAI Compatiable Endpoint
    • gpt-4o-image generates image
    • Chat
    • Recognizing Images
    • Models
    • Embeddings
    • Images
    • Realtime
    • Image Editing (gpt-image-1)
  • Audio
    • Create speech
    • Create transcription
    • Create translation
  • Anthropic Compatiable Endpoint
    • Anthropic Claude
  • Music Generation Endpoint
    • Suno
      • Setting suno Version
      • Generate lyrics
      • Generate music clip
      • Upload clip
      • Submit concatenation
      • Single task query
      • Batch query tasks
    • Udio(Temporarily unavailable)
      • Generate music
      • Task query
  • Image Generation Endpoint
    • Midjourney(images)
      • Quick Tutorial - Complete Process in One Go
      • Task Fetching API
        • List by Condition
        • Fetch Single Task (most recommended)
      • Imagine
      • Action (UPSCALE; VARIATION; REROLL; ZOOM, etc.)
      • Blend (image -> image)
      • Describe (image -> text)
      • Modal (Area Redesign & Zoom)
    • Ideogram(images)
      • Official documentation (updated in real time)
      • Generate 3.0 (text to image)
      • Remix 3.0 (hybrid image)
      • Reframe 3.0(Reconstruction)
      • Replace Background 3.0(Background replacement)
      • Edit 3.0(Editing images)
      • ideogram Text Raw Image
      • ideogram Hybrid image
      • ideogram enlargement HD
      • ideogram describes the image
      • ideogram Edit image
    • Flux(images)
      • Generate image (replicate format)
      • flux fine-tune images(Temporarily unavailable)
      • flux generate image(Temporarily unavailable)
      • flux query
    • Replicate(image)
      • replicate Generate
      • replicate query
    • Recraft(images)
      • Appendix
      • Recraft Generate Image
      • Recraft Vectorize Image
      • Recraft Remove Background
      • Recraft Clarity Upscale
      • Recraft Create style
      • Recraft Generative Upscale
  • Video Generation Ednpoint
    • runway(video)
      • official format
        • runway images raw video
        • runway to get task details
      • Reverse Format
        • generate(text)
        • generate(Reference images)
        • Video to Video Style Redraw
        • Act-one Expression Migration
        • feed-get task
    • kling (video)
      • callback_url
      • Generating images
        POST
      • Text Generation Video
        POST
      • Image Generation Video
        POST
      • Video Extension
        POST
      • virtual try-on
        POST
      • lip sync
        POST
      • Individual queries (videos)
        GET
    • MiniMax Conch(video)
      • MiniMax Conch Official Documentation
      • MiniMax Conch Generation
      • MiniMax Conch Query
      • MiniMax Conch Download
    • luma (video)
      • Official api interface format
        • luma generate
        • luma search
    • PIKA(video)
      • pika feed
      • PIKA Reference Video Generation
      • PIKA Reference Image Generation
      • PIKA reference text generation
    • sora
      • Reverse Format
        • Create Video
        • Query Video Task
        • Create Video
  • Software Integration Guide
    • cometapi Site API Call Testing
    • OpenManus
    • Chatbox
    • CherryStudio
    • Cursor
    • ChatHub
    • COZE
    • FastGPT
    • 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
  1. kling (video)

Image Generation Video

POST
https://api.cometapi.com/kling/v1/videos/image2video
Maintainer:Not configured
This document is not updated in real time, for the full version please check the official document: https://docs.qingque.cn/d/home/eZQClW07IFEuX1csc-VejdY2M

Request

Header Params
Authorization
string 
required
Example:
Bearer {{api-key}}
Body Params application/json
model_name
string 
optional
Default value: kling-v1,Example values:kling-v1,kling-v1-5,kling-v1-6
image
string 
required
Reference image, mandatory, support Base64 encoding or image URL, support .jpg / .jpeg / .png format, size can't be more than 10MB, resolution not less than 300*300px
image_tail
string 
optional
Reference Image - Tail frame control, optional, support Base64 encoding or image URL, support .jpg / .jpeg / .png format, size can't be more than 10MB, resolution not less than 300*300px
prompt
string 
optional
Positive text alert, mandatory, can't exceed 500 characters
negative_prompt
string 
optional
Negative text alert, optional, cannot exceed 200 characters
cfg_scale
number 
optional
Degree of freedom of the generated video, optional, the larger the value, the stronger the correlation, value range: [0,1]
mode
string 
optional
Mode of video generation, optional, enumeration value: std (high performance) or pro (high performance)
static_mask
string 
optional
Static brush applied area (the mask image that the user applied with the motion brush)
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
Dynamic Brush Configuration List
Multiple groups (up to 6) can be configured, each containing a sequence of “paint area masks” and “motion trajectories”.
mask
string 
optional
Dynamic brush applied area (mask image applied by user with motion brush)
● 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
Sequence of motion trajectory coordinates
● 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
Generate video duration in seconds, optional, enumeration value: 5, 10
callback_url
string 
optional
Address for callback notification of the results of this task, optional
external_task_id
string 
optional
Customized Task ID
● 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
Error code; specifically define the error code
message
string 
required
error message
request_id
string 
required
Request ID, system-generated, for tracking requests, troubleshooting issues
data
object 
required
task_id
string 
required
Task ID, system generated
task_status
string 
required
Task status, enumerated values: submitted, processing, succeed, failed.
task_status_msg
string 
required
task_info
object 
required
task_result
object 
required
created_at
integer 
required
Task creation time, Unix timestamp, in ms.
updated_at
integer 
required
Task update time, Unix timestamp, in ms.
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, 
  }
}
Previous
Text Generation Video
Next
Video Extension
Built with