使用 RunComfy 的 API 运行 kling/kling-3.0/4k/image-to-video。 可接受的输入与输出请参阅模型的 数据结构说明。
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/kling/kling-3.0/4k/image-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "Bring this still photograph to life in native 4K with hyper-detailed motion. The young American ceramic artist's hands gently cradle and shape the spinning gray clay vessel — the wheel rotates with smooth controlled motion, the soft clay walls rise and slim under her thumbs, a thin glistening ribbon of water trickles continuously down the side, and a few fine droplets of clay-water flick outward in slow motion catching the light. Loose strands of her dirty-blonde hair sway gently, her chest rises and falls with steady calm breathing, eyes stay focused, a small subtle smile tugs at her lips, the linen apron shifts almost imperceptibly. Behind her, dust motes drift through the warm shaft of honey golden-hour light streaming through the multi-pane windows, dried botanicals sway slightly, and faint shadows shift across the whitewashed brick wall as the sun moves. The camera slowly pushes in from a tight medium close-up to an extreme close-up of the wet clay vessel and her glistening fingers, then drifts back up to her face. Ambient sound: the soft whir of the pottery wheel, water droplets, the rustle of linen, distant Portland street ambience, and a warm vinyl indie-folk record playing low. Native-4K hyper-detailed textures — wet clay surface sheen, fingertip ridges, water droplets, hair strands, linen apron weave, brick grain, wood shelf knots — shot on RED Komodo 6K, 50mm anamorphic, shallow depth of field, Kodak Portra color science.",
"start_image_url": "https://playgrounds-storage-public.runcomfy.net/tools/7353/media-files/input.png"
}'将 YOUR_API_TOKEN 环境变量设置为您的 API 密钥(在 个人资料中管理密钥),并在每个请求的 Authorization 标头中以 Bearer 令牌形式携带: Authorization: Bearer $YOUR_API_TOKEN。
提交异步生成任务,将立即获得 request_id 以及用于查询状态、获取结果和取消的 URL。
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/kling/kling-3.0/4k/image-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "Bring this still photograph to life in native 4K with hyper-detailed motion. The young American ceramic artist's hands gently cradle and shape the spinning gray clay vessel — the wheel rotates with smooth controlled motion, the soft clay walls rise and slim under her thumbs, a thin glistening ribbon of water trickles continuously down the side, and a few fine droplets of clay-water flick outward in slow motion catching the light. Loose strands of her dirty-blonde hair sway gently, her chest rises and falls with steady calm breathing, eyes stay focused, a small subtle smile tugs at her lips, the linen apron shifts almost imperceptibly. Behind her, dust motes drift through the warm shaft of honey golden-hour light streaming through the multi-pane windows, dried botanicals sway slightly, and faint shadows shift across the whitewashed brick wall as the sun moves. The camera slowly pushes in from a tight medium close-up to an extreme close-up of the wet clay vessel and her glistening fingers, then drifts back up to her face. Ambient sound: the soft whir of the pottery wheel, water droplets, the rustle of linen, distant Portland street ambience, and a warm vinyl indie-folk record playing low. Native-4K hyper-detailed textures — wet clay surface sheen, fingertip ridges, water droplets, hair strands, linen apron weave, brick grain, wood shelf knots — shot on RED Komodo 6K, 50mm anamorphic, shallow depth of field, Kodak Portra color science.",
"start_image_url": "https://playgrounds-storage-public.runcomfy.net/tools/7353/media-files/input.png"
}'根据 request_id 获取当前状态("in_queue"、"in_progress"、"completed" 或 "cancelled")。
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/status \
--header "Authorization: Bearer <token>"获取指定 request_id 的最终输出与元数据;若任务未完成,响应会返回当前状态,便于继续轮询。
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/result \
--header "Authorization: Bearer <token>"通过 request_id 取消排队中的任务;进行中的任务无法取消。
curl --request POST \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/cancel \
--header "Authorization: Bearer <token>"请提供可公网访问的 HTTPS 地址。确保目标主机允许服务端拉取(无需登录或 Cookie)、未被限流或拦截爬虫。建议:图片 ≤ 50 MB(约 4K),视频 ≤ 100 MB(约 720p 下 2–5 分钟)。私有资源请使用稳定或预签名 URL。
{
"type": "object",
"title": "输入结构",
"required": [
"prompt",
"start_image_url"
],
"properties": {
"prompt": {
"title": "提示词",
"description": "",
"type": "string",
"default": "Bring this still photograph to life in native 4K with hyper-detailed motion. The young American ceramic artist's hands gently cradle and shape the spinning gray clay vessel — the wheel rotates with smooth controlled motion, the soft clay walls rise and slim under her thumbs, a thin glistening ribbon of water trickles continuously down the side, and a few fine droplets of clay-water flick outward in slow motion catching the light. Loose strands of her dirty-blonde hair sway gently, her chest rises and falls with steady calm breathing, eyes stay focused, a small subtle smile tugs at her lips, the linen apron shifts almost imperceptibly. Behind her, dust motes drift through the warm shaft of honey golden-hour light streaming through the multi-pane windows, dried botanicals sway slightly, and faint shadows shift across the whitewashed brick wall as the sun moves. The camera slowly pushes in from a tight medium close-up to an extreme close-up of the wet clay vessel and her glistening fingers, then drifts back up to her face. Ambient sound: the soft whir of the pottery wheel, water droplets, the rustle of linen, distant Portland street ambience, and a warm vinyl indie-folk record playing low. Native-4K hyper-detailed textures — wet clay surface sheen, fingertip ridges, water droplets, hair strands, linen apron weave, brick grain, wood shelf knots — shot on RED Komodo 6K, 50mm anamorphic, shallow depth of field, Kodak Portra color science."
},
"multi_prompt": {
"title": "多段提示词",
"description": "提供多个提示词片段来控制场景转场。所有片段的时长之和必须等于视频总时长。",
"type": "array",
"items": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"format": "str"
},
"duration": {
"type": "integer",
"format": "int_slider_with_range",
"minimum": 3,
"maximum": 15,
"default": 5
}
}
},
"maxItems": 20,
"minItems": 0
},
"start_image_url": {
"title": "起始图像",
"description": "视频的起始画面。支持 jpg、jpeg、png、bmp、webp 格式。",
"type": "string",
"default": "https://playgrounds-storage-public.runcomfy.net/tools/7353/media-files/input.png"
},
"end_image_url": {
"title": "结束图像",
"description": "可选的结束画面,用于精确控制两个画面之间的过渡。支持 jpg、jpeg、png、bmp、webp 格式。",
"type": "string"
},
"duration": {
"title": "时长",
"description": "生成视频的总时长,单位为秒。",
"type": "integer",
"minimum": 3,
"maximum": 15,
"default": 10
},
"generate_audio": {
"title": "生成音频",
"description": "启用后将为视频生成音频。",
"type": "boolean",
"default": true
},
"elements": {
"title": "参考元素",
"description": "用于生成的素材,包括参考图像和视频片段。",
"type": "array",
"items": {
"type": "object",
"properties": {
"frontal_image_url": {
"type": "string",
"format": "image_uri",
"description": "主体的正面参考图像。"
},
"reference_image_urls": {
"type": "array",
"format": "image_uris",
"items": {
"type": "string",
"format": "image_uri"
},
"description": "用于引导画面生成的其他参考图像 URL。"
},
"video_url": {
"type": "string",
"format": "video_uri",
"description": "可选的源视频,用作动作参考。"
}
}
},
"minItems": 0,
"maxItems": 3
},
"shot_type": {
"title": "镜头模式",
"description": "定义镜头处理或场景取景方式。",
"type": "string",
"enum": [
"customize"
],
"default": "customize"
},
"negative_prompt": {
"title": "负面提示词",
"description": "",
"type": "string"
},
"cfg_scale": {
"title": "引导强度",
"description": "无分类器引导(CFG)强度,用于控制结果遵循提示词的程度。",
"type": "float",
"minimum": 0,
"maximum": 1,
"default": 0.5
}
}
}{
"output": {
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "uri",
"description": "单张图片 URL"
},
"video": {
"type": "string",
"format": "uri",
"description": "单个视频 URL"
},
"images": {
"type": "array",
"description": "多张图片 URL",
"items": {
"type": "string",
"format": "uri"
}
},
"videos": {
"type": "array",
"description": "多个视频 URL",
"items": {
"type": "string",
"format": "uri"
}
}
}
}
}RunComfy 是首选的 ComfyUI 平台,提供 ComfyUI 在线 环境和服务,以及 ComfyUI 工作流 具有惊艳的视觉效果。 RunComfy还提供 AI Models, 帮助艺术家利用最新的AI工具创作出令人惊叹的艺术作品。