Используйте API RunComfy для запуска kling/kling-3.0/4k/text-to-video. Допустимые входы и выходы см. в схеме.
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/kling/kling-3.0/4k/text-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "Native-4K cinematic multi-shot of a Brooklyn artisan coffee shop on a rainy autumn morning. Wide establishing shot through a fogged-up window: a bearded American barista in a denim apron stands behind a polished copper espresso machine, brass fixtures glowing under warm Edison bulbs, exposed brick and hanging plants in the background. Cut to an extreme macro close-up of milk being steamed, micro-foam swirling with visible bubbles and droplets. Cut to a top-down macro shot of his hands pouring a perfect rosetta latte art into a matte ceramic cup, golden crema rippling in slow motion. Cut to a young woman in a cream cable-knit sweater receiving the cup, soft window light catching freckles on her cheeks, green eyes warming as she smiles. Final shot: a slow dolly-out reveals the cozy industrial interior — vinyl records spinning, a chalkboard menu, raindrops streaking the window. Sound of espresso machine hissing, gentle rain on glass, soft indie acoustic guitar. Hyper-detailed textures: yarn weave, hair strands, crema bubbles, raindrop refraction — shot on RED Komodo 6K, anamorphic lenses, shallow depth of field, Kodak Portra color science."
}'Задайте для переменной окружения YOUR_API_TOKEN ваш API-ключ (управление в Профиль) и передавайте в каждом запросе Bearer-токен в заголовке Authorization : Authorization: Bearer $YOUR_API_TOKEN.
Отправьте асинхронную задачу генерации и сразу получите request_id и URL для статуса, результатов и отмены.
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/kling/kling-3.0/4k/text-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "Native-4K cinematic multi-shot of a Brooklyn artisan coffee shop on a rainy autumn morning. Wide establishing shot through a fogged-up window: a bearded American barista in a denim apron stands behind a polished copper espresso machine, brass fixtures glowing under warm Edison bulbs, exposed brick and hanging plants in the background. Cut to an extreme macro close-up of milk being steamed, micro-foam swirling with visible bubbles and droplets. Cut to a top-down macro shot of his hands pouring a perfect rosetta latte art into a matte ceramic cup, golden crema rippling in slow motion. Cut to a young woman in a cream cable-knit sweater receiving the cup, soft window light catching freckles on her cheeks, green eyes warming as she smiles. Final shot: a slow dolly-out reveals the cozy industrial interior — vinyl records spinning, a chalkboard menu, raindrops streaking the window. Sound of espresso machine hissing, gentle rain on glass, soft indie acoustic guitar. Hyper-detailed textures: yarn weave, hair strands, crema bubbles, raindrop refraction — shot on RED Komodo 6K, anamorphic lenses, shallow depth of field, Kodak Portra color science."
}'Текущее состояние по 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 URL. Хост должен разрешать серверные запросы (без входа и cookie), без жёсткого лимита и блокировки ботов. Рекомендуется: изображения ≤ 50 МБ (~4K), видео ≤ 100 МБ (~2–5 мин при 720p). Для приватных ресурсов — стабильные или подписанные URL.
{
"type": "object",
"title": "Схема входа",
"required": [
"prompt"
],
"properties": {
"prompt": {
"title": "Промпт",
"description": "Текстовое описание сцены, движения, стиля камеры и атмосферы.",
"type": "string",
"default": "Native-4K cinematic multi-shot of a Brooklyn artisan coffee shop on a rainy autumn morning. Wide establishing shot through a fogged-up window: a bearded American barista in a denim apron stands behind a polished copper espresso machine, brass fixtures glowing under warm Edison bulbs, exposed brick and hanging plants in the background. Cut to an extreme macro close-up of milk being steamed, micro-foam swirling with visible bubbles and droplets. Cut to a top-down macro shot of his hands pouring a perfect rosetta latte art into a matte ceramic cup, golden crema rippling in slow motion. Cut to a young woman in a cream cable-knit sweater receiving the cup, soft window light catching freckles on her cheeks, green eyes warming as she smiles. Final shot: a slow dolly-out reveals the cozy industrial interior — vinyl records spinning, a chalkboard menu, raindrops streaking the window. Sound of espresso machine hissing, gentle rain on glass, soft indie acoustic guitar. Hyper-detailed textures: yarn weave, hair strands, crema bubbles, raindrop refraction — shot on RED Komodo 6K, anamorphic lenses, shallow depth of field, Kodak Portra color science."
},
"negative_prompt": {
"title": "Негативный промпт",
"description": "Элементы, которые следует исключить из видео.",
"type": "string"
},
"duration": {
"title": "Длительность",
"description": "Продолжительность видео в секундах.",
"type": "integer",
"minimum": 3,
"maximum": 15,
"default": 5
},
"aspect_ratio": {
"title": "Соотношение сторон (Ш:В)",
"description": "Коэффициент вывода сгенерированного видео.",
"type": "string",
"enum": [
"16:9",
"9:16",
"1:1"
],
"default": "16:9"
},
"cfg_scale": {
"title": "Шкала соответствия промпту",
"description": "Степень соответствия результата промпту.",
"type": "float",
"minimum": 0,
"maximum": 1,
"default": 0.5
},
"sound": {
"title": "Аудио",
"description": "Генерируйте синхронизированный звук вместе с видео.",
"type": "boolean",
"default": true
},
"multi_prompt": {
"title": "Сегменты промпта",
"description": "Дополнительные сегменты промптов для управления переходами и развитием сцен. Сумма длительностей в multi_prompt должна равняться общей продолжительности видео.",
"type": "array",
"items": {
"prompt": {
"title": "Промпт",
"description": "Дополнительные сегменты промптов для управления переходами и развитием сцен.",
"type": "string",
"format": "str"
},
"duration": {
"title": "Продолжительность",
"description": "Продолжительность сегмента промпта в секундах.",
"type": "integer",
"format": "int_slider_with_range",
"minimum": 3,
"maximum": 15,
"default": 5
}
},
"maxItems": 20,
"minItems": 0
},
"shot_type": {
"title": "Тип плана",
"description": "Режим редактирования: интеллектуальный (по умолчанию, область определяется автоматически) или настраиваемый.",
"type": "string",
"enum": [
"customize"
],
"default": "customize"
}
}
}{
"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 для создания невероятного искусства.