KLING V1.6 图生视频
curl --request POST \
--url https://api.highwayapi.ai/v3/async/kling-v1.6-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mode": "<string>",
"image_url": "<string>",
"end_image_url": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"duration": 123,
"guidance_scale": 123
}
'import requests
url = "https://api.highwayapi.ai/v3/async/kling-v1.6-i2v"
payload = {
"mode": "<string>",
"image_url": "<string>",
"end_image_url": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"duration": 123,
"guidance_scale": 123
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
mode: '<string>',
image_url: '<string>',
end_image_url: '<string>',
prompt: '<string>',
negative_prompt: '<string>',
duration: 123,
guidance_scale: 123
})
};
fetch('https://api.highwayapi.ai/v3/async/kling-v1.6-i2v', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/kling-v1.6-i2v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => '<string>',
'image_url' => '<string>',
'end_image_url' => '<string>',
'prompt' => '<string>',
'negative_prompt' => '<string>',
'duration' => 123,
'guidance_scale' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/kling-v1.6-i2v"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"end_image_url\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/kling-v1.6-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"mode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"end_image_url\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/kling-v1.6-i2v")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"mode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"end_image_url\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}视频
KLING V1.6 图生视频
POST
/
v3
/
async
/
kling-v1.6-i2v
KLING V1.6 图生视频
curl --request POST \
--url https://api.highwayapi.ai/v3/async/kling-v1.6-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mode": "<string>",
"image_url": "<string>",
"end_image_url": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"duration": 123,
"guidance_scale": 123
}
'import requests
url = "https://api.highwayapi.ai/v3/async/kling-v1.6-i2v"
payload = {
"mode": "<string>",
"image_url": "<string>",
"end_image_url": "<string>",
"prompt": "<string>",
"negative_prompt": "<string>",
"duration": 123,
"guidance_scale": 123
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
mode: '<string>',
image_url: '<string>',
end_image_url: '<string>',
prompt: '<string>',
negative_prompt: '<string>',
duration: 123,
guidance_scale: 123
})
};
fetch('https://api.highwayapi.ai/v3/async/kling-v1.6-i2v', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/kling-v1.6-i2v",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mode' => '<string>',
'image_url' => '<string>',
'end_image_url' => '<string>',
'prompt' => '<string>',
'negative_prompt' => '<string>',
'duration' => 123,
'guidance_scale' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/kling-v1.6-i2v"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"end_image_url\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/kling-v1.6-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"mode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"end_image_url\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/kling-v1.6-i2v")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"mode\": \"<string>\",\n \"image_url\": \"<string>\",\n \"end_image_url\": \"<string>\",\n \"prompt\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"duration\": 123,\n \"guidance_scale\": 123\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}KLING V1.6 图生视频是快手 AI 团队开发的 AI 图像生成视频模型。它可以将图片转换为动态的 5 秒视频,支持 720p / 1080p 分辨率,具备高质量的视觉输出、增强的运动与语义理解能力。
这是一个异步API,只会返回异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 来检索视频生成结果。
请求头
枚举值:
application/jsonBearer 身份验证格式: Bearer {{API 秘钥}}。
请求体
视频生成模式。支持:
Standard:快速生成,成本较低,生成 720p 视频。Professional:高质量,成本较高,生成 1080p 视频,并允许设置结束帧。
Standard。用于视频生成的起始帧图片的 URL。
用于视频生成的结束帧图片的 URL。
仅当
mode 为 Professional 时可用。指导生成所需的提示词。取值范围:
1 <= x <= 2000。负面提示词,用于指示模型应避免生成的内容。取值范围:
0 <= x <= 2000。生成视频的时长(秒)。默认值:
可选值:
5。可选值:
5、10指导强度参数,控制生成内容与提示词的贴合程度。取值范围:
0 <= x <= 1。默认值:0.5。响应信息
异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 以获取生成结果
⌘I