跳转到内容

Kling 4.0 Reference to Video

集成

模型 id kling/v4/reference-to-video
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/kling/v4/reference-to-video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

与示例类似的文件: $1.175 1,175 API 积分 运行前会测量你的文件 在此页面运行

获取 API 密钥
Kling 参考图生视频 参考输入3–30 秒最高 1080p #reference-to-video#multi-shot#image-reference#video-reference

生成 3-30 秒视频,保持最多 10 张参考图像、5 个参考视频和 7 个元素的外观

在 Doitong 上制作

Doitong 社区使用 Kling 4.0 制作的公开作品。一键复用提示词。

显示的公开作品:16
**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animat... 视频

**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...

**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animat... 视频

**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...

**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animat... 视频

**Duration: 5 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...

Уютная база отдыха с деревянными домиками-шале среди сосен. Майя и Клиентка заходят в теплое кафе... 视频

Уютная база отдыха с деревянными домиками-шале среди сосен. Майя и Клиентка заходят в теплое кафе с панорамными окнами. Внутри деревянный интерьер, мягкие диваны и живые цветы. Они садятся за столик, перед ними стоят дымящиеся чашки чая. Мягкий свет ламп создает уют. Средний план, уровень глаз. (...

**Duration: 4 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animat... 视频

**Duration: 4 seconds | Aspect ratio: 16:9 | Children's YouTube Intro | Video with Audio** Animate the provided image into a bright, magical, energetic, professional YouTube intro for a children's entertainment channel, with perfectly synchronized sound effects, cheerful music, and a cute child's...

Реалистично оживи старую семейную фотографию. Все люди сохраняют свои оригинальные лица, черты вн... 视频

Реалистично оживи старую семейную фотографию. Все люди сохраняют свои оригинальные лица, черты внешности, возраст, причёски и одежду. Мужчины слегка поворачивают головы, естественно моргают и едва заметно улыбаются. Женщина слева спокойно смотрит в камеру и мягко моргает. Маленький ребёнок слегка...

Create a realistic 30-second vertical 9:16 video showing two construction workers installing larg... 视频

Create a realistic 30-second vertical 9:16 video showing two construction workers installing large white patio tiles in a modern backyard. Show the entire construction process in a smooth timelapse. Gradually transform the unfinished backyard into a luxurious outdoor living space with an L-shaped...

Create a warm, emotional 8–10 second cinematic video showing the difference between a young child... 视频

Create a warm, emotional 8–10 second cinematic video showing the difference between a young child playing alone and playing with their mother. Scene 1: A toddler sits on the floor playing with toys independently. The child is calm and focused, exploring and learning through independent play. The...

构建请求

控件根据模型架构生成。更改控件时,代码和价格会同步更新。

88 / 2500

满足必须提供 `prompt` 或 `multi_prompt` 要求的生成指令。要引用提供的输入,请使用 @Image1、@Video1、@Element1 等。

video_urls
拖放文件,或 · 最多 5 个

最多 5 个参考视频,使用 @Video1、@Video2 等引用;每个视频时长为 3–30 秒(最多 30.05 秒),与元素视频合计不得超过 30 秒。每个文件不得超过 300 MB,宽度和高度均为 700 px 至 4553 px。宽高比必须为 0.40–2.50,帧率为 23.9–60.05 FPS。

resolution 默认 1080p

输出的分辨率。

aspect_ratio 默认 16:9

视频比例,可显式选择,或选择 'auto' 根据参考内容推导。

默认 5

视频时长(秒),范围为 3 到 30。

高级 image · images · multi_prompt · elements
start_image_url
拖放文件,或

可选的首帧图像,会计入图像参考数量限制。文件大小最大为 30.0 MB;宽度和高度都必须达到 300 px,宽高比介于 0.40 和 2.50 之间。

image_urls
拖放文件,或 · 最多 10 个

使用 @Image1、@Image2 等引用的图像参考,最多 10 张。每个文件大小限制为 30.0 MB,两个维度都至少为 300 px,宽高比必须介于 0.40 和 2.50 之间。

逐镜头生成指令,每个提示词定义一个镜头,其时长计入视频总时长。

最多 7 个角色或对象,其中最多 3 个可包含 `voice_id`,最多 3 个可使用视频。使用 @Element1、@Element2 等引用这些元素。

POST /run/kling/v4/reference-to-video?wait=20 报价 → $1.175
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/kling/v4/reference-to-video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 Kling 4.0 Reference to Video

根据文本 `prompt` 以及参考图像、参考视频和角色或对象元素创建视频,这些元素在提示词中以 @Image1、@Video1 或 @Element1 的形式引用。时长为 3 到 30 秒(默认 5),输出分辨率为 720p 或 1080p,宽高比可选 auto、16:9、9:16、1:1 或 21:9。使用 `multi_prompt` 可为每个镜头提供提示词,此时总时长为各镜头时长之和。上限为 10 张图像、5 个时长为 3-30s 的视频和 7 个元素,其中最多 3 个元素可以携带语音。

参数

发送规范名称或原生名称之一,不要同时发送两者。 规范名称

名称类型 默认值允许值 描述
prompt可选
类型string | null
≤ 2,500 个字符
满足必须提供 `prompt` 或 `multi_prompt` 要求的生成指令。要引用提供的输入,请使用 @Image1、@Video1、@Element1 等。
multi_prompt可选
类型object[]
逐镜头生成指令,每个提示词定义一个镜头,其时长计入视频总时长。
multi_prompt[].prompt必填
类型string
1 – 512 characters
当前镜头的文本指令。
multi_prompt[].duration可选
类型integer
默认值5
1 – 30
单个镜头的时长,以秒为单位。
duration可选
类型integer
默认值5
3 – 30
视频时长(秒),范围为 3 到 30。
start_image_url可选 image
类型url · image
可选的首帧图像,会计入图像参考数量限制。文件大小最大为 30.0 MB;宽度和高度都必须达到 300 px,宽高比介于 0.40 和 2.50 之间。
image_urls可选 images
类型url[] · image
≤ 10 个项目
使用 @Image1、@Image2 等引用的图像参考,最多 10 张。每个文件大小限制为 30.0 MB,两个维度都至少为 300 px,宽高比必须介于 0.40 和 2.50 之间。
video_urls可选 videos
类型url[] · video
≤ 5 个项目
最多 5 个参考视频,使用 @Video1、@Video2 等引用;每个视频时长为 3–30 秒(最多 30.05 秒),与元素视频合计不得超过 30 秒。每个文件不得超过 300 MB,宽度和高度均为 700 px 至 4553 px。宽高比必须为 0.40–2.50,帧率为 23.9–60.05 FPS。
elements可选
类型object[]
≤ 7 个项目
最多 7 个角色或对象,其中最多 3 个可包含 `voice_id`,最多 3 个可使用视频。使用 @Element1、@Element2 等引用这些元素。
elements[].frontal_image_url可选
类型url · image
展示元素主要视角的正面图像。文件大小最大为 30.0 MB;两个维度都必须至少为 300 px,宽高比必须介于 0.40 和 2.50 之间。
elements[].reference_image_urls可选
类型url[] · image
≤ 3 items
展示元素不同角度的补充图像,提供 1 到 3 个视角。每个文件最大为 30.0 MB,两个维度都必须至少为 300 px,宽高比必须介于 0.40 和 2.50 之间。
elements[].video_url可选
类型url · video
替代图像的元素视频表示,时长为 3–30 秒(最多 30.05 秒)。文件不得超过 300 MB;宽度和高度都必须在 700–4553 px 之间。支持的宽高比为 0.40–2.50,帧率为 23.9–60.05 FPS。
elements[].voice_id可选
类型string | null
分配给元素的语音。
resolution可选
类型enum
默认值1080p
720p1080p
输出的分辨率。
aspect_ratio可选
类型enum
默认值16:9
auto16:99:161:121:9
视频比例,可显式选择,或选择 'auto' 根据参考内容推导。
必填 规范名称,也可接受

文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "kling/v4/reference-to-video",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 1175,
    "usd": "1.175",
    "charged": 1175,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "video": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_name": "0-output.mp4",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "video",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_size": 1843200,
      "width": 1280,
      "height": 720,
      "duration": 5,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
video
object {url, content_type, file_name, file_size}模型生成的视频。

更多模型:参考图生视频

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/kling/v4/reference-to-video.md. 所有模型和指南: https://doitong.com/developers/llms.txt