图像扩展
通过 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.