跳至內容

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://vit.doitong.com/api/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://vit.doitong.com/api/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 個元素的外觀

Kling · 影片

您的第一個結果會顯示在這裡

在下方建立請求,並使用您的 API 金鑰執行。輸出會複製到我們的儲存空間,可永久保留或免費保留 7 天。

建立請求

控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。

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://vit.doitong.com/api/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://vit.doitong.com/api/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://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://vit.doitong.com/api/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-TW/developers/models/kling/v4/reference-to-video.md. 所有模型與指南: https://doitong.com/developers/llms.txt