輸出解析度
支援公開 endpoint 架構中的 1k, 2k。
curl -X POST https://runapi.ai/api/v1/kling/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v4-long-image",
"prompt": "A red apple on a white table",
"output_resolution": "2k",
"skill": "ecommerce",
"source_image_urls": [
"https://cdn.runapi.ai/public/samples/image.jpg"
]
}'
import { KlingClient } from "@runapi.ai/kling";
const client = new KlingClient();
const result = await client.textToImage.run({
model: "kling-v4-long-image",
prompt: "A red apple on a white table",
output_resolution: "2k",
skill: "ecommerce",
source_image_urls: ["https://cdn.runapi.ai/public/samples/image.jpg"],
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/kling/text_to_image",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"kling-v4-long-image","prompt":"A red apple on a white table","output_resolution":"2k","skill":"ecommerce","source_image_urls":["https://cdn.runapi.ai/public/samples/image.jpg"]}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/kling/text_to_image");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'kling-v4-long-image',
'prompt' => 'A red apple on a white table',
'output_resolution' => '2k',
'skill' => 'ecommerce',
'source_image_urls' => ['https://cdn.runapi.ai/public/samples/image.jpg'],
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToImage().run({"model":"kling-v4-long-image","prompt":"A red apple on a white table","output_resolution":"2k","skill":"ecommerce","source_image_urls":["https://cdn.runapi.ai/public/samples/image.jpg"]});
task.waitForResult();
require "runapi/kling"
client = RunApi::Kling::Client.new
result = client.text_to_image.run(
model: "kling-v4-long-image",
prompt: "A red apple on a white table",
output_resolution: "2k",
skill: "ecommerce",
source_image_urls: ["https://cdn.runapi.ai/public/samples/image.jpg"]
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToImage.Run({"model":"kling-v4-long-image","prompt":"A red apple on a white table","output_resolution":"2k","skill":"ecommerce","source_image_urls":["https://cdn.runapi.ai/public/samples/image.jpg"]})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model kling-v4-long-image \
--endpoint text_to_image \
--wait
24 個版本可用
選擇任一模型,幾秒內即可開始生成。
| 提供者 | Kuaishou |
| 模型 ID | kling-v4-long-image |
| 模態 | 圖像 |
| 任務類型 | Asynchronous |
| API 端點 | /api/v1/kling/text_to_image |
| 計費單位 | 次呼叫 |
| 輸入參數 | callback_url, length, model, output_resolution, prompt, skill, source_image_urls, style_image_url, subject_image_url |
| 最大解析度 | 1k, 2k |
| 目錄狀態 | 可直接上線 |
免費註冊後,從控制台建立 kling-v4-long-image 的 API 金鑰。
向 /api/v1/kling/text_to_image 傳送 POST 請求,並傳入 kling-v4-long-image 模型 ID 與參數。
輪詢工作或依照回呼取得已完成的 kling-v4-long-image 結果。
支援公開 endpoint 架構中的 1k, 2k。
可設定 7 個已記錄的參數,包括 length, output_resolution, prompt, skill, source_image_urls。
公開 1 個公共 endpoint:text_to_image。
非同步任務接受回呼 URL 以接收完成通知。
skillLong-image skill; case insensitive. (ecommerce, webpage)
lengthEcommerce image length. (short, medium, long)
promptLong image description. References must name supplied images: @image_N, @style or @subject.
callback_urlWebhook URL for async notifications.
style_image_urlOptional webpage style reference: public HTTP/HTTPS JPG or PNG, at most 20 MB.
output_resolutionOutput resolution. (1k, 2k)
source_image_urlsEcommerce product images: public HTTP/HTTPS JPG or PNG, at most 20 MB each.
subject_image_urlOptional webpage subject reference: public HTTP/HTTPS JPG or PNG, at most 20 MB.
為缺少棚拍照片的電商型錄,自動生成生活風格產品照片。
在定稿前快速發想場景與角色概念。
大規模生成部落格文章與專欄所需的獨特封面與插圖。
傳入 quickstart 顯示的 model ID。
每個金鑰的速率限制會依使用方案而調整。請查看定價頁面以了解目前限制。
可以——variant 只是旗標。只要變更 model 參數即可切換。
只要支援串流,RunAPI 就會端到端串流。
請在公開 GitHub repo 提交 issue,或寄信給支援。
不需要。你的 RunAPI API key 足以存取此 variant 及目錄中的所有其他模型,無需底層供應商帳戶。