curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "kwaivgi/kling-image-v4.0/long-image",
"input": {
"skill": "webpage",
"prompt": "Design a long image for a specialty coffee brand's official website, including the hero section, product showcase, roasting philosophy, store information, and footer. Follow the visual style of @StyleImage.",
"style_image_url": "https://cdn.vidgo.ai/temp/style-reference.png",
"resolution": "2K"
}
}
EOF{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}Kling
Kling Image 4.0 长图
Kling Image 4.0 长图 API 根据提示词和最多 3 张参考图,把整页网页或电商详情页设计成一张 1K 或 2K 宽的长图。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"model": "kwaivgi/kling-image-v4.0/long-image",
"input": {
"skill": "webpage",
"prompt": "Design a long image for a specialty coffee brand's official website, including the hero section, product showcase, roasting philosophy, store information, and footer. Follow the visual style of @StyleImage.",
"style_image_url": "https://cdn.vidgo.ai/temp/style-reference.png",
"resolution": "2K"
}
}
EOF{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
skill: webpage),或基于 1–3 张商品图的电商详情页(skill: ecommerce)。宽度由 resolution 决定,高度随内容变化,一次请求即可得到包含全部版块的完整页面效果图。
生成普通图片请使用 Kling Image 4.0 文生图 或 Kling Image 4.0 图像编辑。
模型
- kwaivgi/kling-image-v4.0/long-image — 每次生成一张网页或电商详情页长图,宽 1K 或 2K。
功能
- 网页设计,可选风格参考图(
@StyleImage)和主体参考图(@SubjectImage)。 - 基于 1–3 张商品图的电商详情页,三种长度(
short、medium、long)。 - 1K(宽 1024 像素)或 2K(宽 2048 像素)输出,高度随内容变化。
输入模式
skill | 输入 | 可选 |
|---|---|---|
webpage(默认) | prompt | style_image_url、subject_image_url、resolution |
ecommerce | prompt、image_urls(1–3 张商品图) | length、resolution |
必填参数
prompt(string):页面及各版块的描述。1–50,000 个字符的文本。用@Image1–@Image3引用商品图,用@StyleImage引用风格参考图,用@SubjectImage引用主体参考图。image_urls(string[]):用于skill: ecommerce,该模式下必填:1–3 张商品图,按顺序编号为@Image1–@Image3。每张图片须是公开可访问的 HTTP(S) URL,最大 30 MB,宽和高都至少 300 像素,宽高比(宽 / 高)在 0.4 到 2.5 之间。
可选参数
skill(string):webpage或ecommerce。默认webpage。style_image_url(string):仅skill: webpage。设计沿用这张图的视觉和版式风格(@StyleImage)。subject_image_url(string):仅skill: webpage。设计围绕这张图中的主体展开(@SubjectImage)。length(string):仅skill: ecommerce。short(约 2–5 个版块)、medium(约 6–10 个)或long(约 11–18 个)。默认medium。resolution(string):1K(宽 1024 像素)或2K(宽 2048 像素)。默认1K。
输出
- 每次请求返回一张 PNG 长图。1K 网页通常约 1024x5800 像素;2K 长版电商详情页高度可超过 50,000 像素、体积超过 80 MB。
- 生成通常需要 1.5–4 分钟,2K 长版页面最长约 12 分钟。
示例
- 网页:参照风格图设计的咖啡品牌官网,
2K。 - 电商详情页:基于一张商品图的
medium长度详情页,1K。
注意事项
- 每种 skill 使用各自的字段:
skill: ecommerce使用 1–3 张image_urls和length,skill: webpage使用style_image_url和subject_image_url。传入另一种 skill 的字段会返回 400。 model和callback_url放在请求根级,与input并列。input接收上文列出的字段,其他字段返回 400。- 每次请求按固定积分计费,取决于
skill、length(ecommerce时)和resolution,每张参考图(商品图、风格图或主体图)另有加价。任务失败会全额退还。当前费率见定价页。
请求体
application/json