影像擴展
透過 CometAPI 使用 Kling 影像擴展 API,在保留上下文的同時將影像擴展至原始邊界之外,並可控制填補內容,以產出適用於影片的素材。
當你需要在來源內容周圍擴增更多畫布時,可使用此端點將影像向原始邊界之外進行外延補圖。Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
擴展比例的運作方式
- 每個比例都是相對於原始寬度或高度進行計算
- 擴展後的合併畫布仍必須符合 Kling 文件中記載的面積限制
- 在嘗試更大範圍的擴展之前,請先從每側
0.1之類的較小數值開始
目前可用性
- 文件中記載的路由為
POST /kling/v1/images/editing/expand - 此端點會回傳 404 回應
授權
Bearer token authentication. Use your CometAPI key.
標頭
Optional content type header.
主體
Source image to expand. Accepts an image URL or raw Base64 string (no data: prefix). Supported formats: JPG, JPEG, PNG. Max 10 MB, minimum 300×300 px, aspect ratio between 1:2.5 and 2.5:1.
Upward expansion as a multiple of the original image height. Range: 0–2. The resulting image area must not exceed 3× the original.
Rightward expansion as a multiple of the original image width. Range: 0–2. The resulting image area must not exceed 3× the original.
Leftward expansion as a multiple of the original image width. Range: 0–2. The resulting image area must not exceed 3× the original.
Downward expansion as a multiple of the original image height. Range: 0–2. The resulting image area must not exceed 3× the original.
Optional text prompt to guide the expanded area content. Max 2500 characters.
Number of expanded images to generate.
Webhook URL for task status notifications. The server sends a callback when the task status changes.
Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.