Kling Image 4.0
原生 2K、4K、8K 出图,支持文生图和最多 10 张参考图的图生图。
| 模型 ID | 别名 | 接口 |
|---|---|---|
klingai/kling-image-4.0 |
kling-image-4.0 |
图片生成 |
输入模式
| 模式 | 参考数量 | 参考角色 |
|---|---|---|
text 纯文本 |
— | — |
image 图片输入 |
1–10 | reference_image |
提示词上限:21000 个字符,超出时返回 400。
参数
| 参数 | 说明 | 取值 | 默认值 | 必填 |
|---|---|---|---|---|
resolution |
分辨率:输出内容的分辨率。 | 2K、4K、8K |
2K |
否 |
aspect_ratio |
画幅:输出内容的宽高比。 | 1:1、16:9、9:16、4:3、3:4、3:2、2:3、21:9 |
1:1 |
否 |
n |
单次请求输出数量:单次 API 请求(一个 Job)的输出数量,不是应用的批量张数。应用可提交多个独立请求组成一批;n=1 不表示应用只能生成一张。 | 1 |
1 |
否 |
示例
text 输入:
{
"model": "klingai/kling-image-4.0",
"input": {
"type": "text",
"prompt": "A watercolor fox reading a map in a pine forest"
},
"parameters": {
"resolution": "2K",
"aspect_ratio": "1:1",
"n": 1
}
}
image 输入:
{
"model": "klingai/kling-image-4.0",
"input": {
"type": "image",
"prompt": "A watercolor fox reading a map in a pine forest",
"references": [
{
"role": "reference_image",
"file_id": "file_..."
}
]
},
"parameters": {
"resolution": "2K",
"aspect_ratio": "1:1",
"n": 1
}
}
完整合同以 GET /v1/models/klingai/kling-image-4.0?view=contract 为准。参数合法不代表每个渠道都能执行,请对完整请求报价。价格与渠道见模型市场。