Utilisez l'API RunComfy pour exécuter kling/kling-3.0/4k/text-to-video. Pour les entrées et sorties acceptées, voir le schéma.
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."
}'Définissez la variable d'environnement YOUR_API_TOKEN avec votre clé API (gestion dans Profil) et incluez à chaque requête un jeton Bearer dans l'en-tête Authorization : Authorization: Bearer $YOUR_API_TOKEN.
Soumettez une tâche de génération asynchrone et recevez immédiatement un request_id ainsi que des URLs pour le statut, les résultats et l'annulation.
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."
}'Récupère l'état actuel pour un request_id (« in_queue », « in_progress », « completed » ou « cancelled »).
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/status \
--header "Authorization: Bearer <token>"Récupère les sorties finales et métadonnées pour le request_id ; si le travail n'est pas terminé, la réponse indique l'état actuel pour poursuivre le polling.
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/result \
--header "Authorization: Bearer <token>"Annule un travail en file d'attente via request_id ; les travaux en cours ne peuvent pas être annulés.
curl --request POST \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/cancel \
--header "Authorization: Bearer <token>"Fournissez une URL HTTPS accessible publiquement. L'hôte doit autoriser les récupérations côté serveur (sans login/cookies), sans limitation de débit ni blocage des bots. Recommandé : images ≤ 50 Mo (~4K), vidéos ≤ 100 Mo (~2–5 min en 720p). Préférez des URL stables ou pré-signées pour les actifs privés.
{
"type": "object",
"title": "Schéma d'entrée",
"required": [
"prompt"
],
"properties": {
"prompt": {
"title": "Prompt",
"description": "Description textuelle de la scène, du mouvement, du style de caméra et de l'atmosphère.",
"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": "Negative Prompt",
"description": "Éléments à exclure de la vidéo.",
"type": "string"
},
"duration": {
"title": "Durée",
"description": "Durée de la vidéo en secondes.",
"type": "integer",
"minimum": 3,
"maximum": 15,
"default": 5
},
"aspect_ratio": {
"title": "Rapport hauteur/largeur",
"description": "Rapport d’aspect de la vidéo générée.",
"type": "string",
"enum": [
"16:9",
"9:16",
"1:1"
],
"default": "16:9"
},
"cfg_scale": {
"title": "Échelle CFG",
"description": "Intensité de suivi du prompt.",
"type": "float",
"minimum": 0,
"maximum": 1,
"default": 0.5
},
"sound": {
"title": "Son",
"description": "Générez un son synchronisé avec la vidéo.",
"type": "boolean",
"default": true
},
"multi_prompt": {
"title": "Multi-prompt",
"description": "Segments de prompts supplémentaires pour guider les transitions et les progressions de scène. La somme des durées dans multi_prompt doit être égale à la durée totale de la vidéo",
"type": "array",
"items": {
"prompt": {
"title": "Prompt",
"description": "Segments de prompts supplémentaires pour guider les transitions et les progressions de scène.",
"type": "string",
"format": "str"
},
"duration": {
"title": "Durée",
"description": "Durée du segment prompt en secondes.",
"type": "integer",
"format": "int_slider_with_range",
"minimum": 3,
"maximum": 15,
"default": 5
}
},
"maxItems": 20,
"minItems": 0
},
"shot_type": {
"title": "Type de plan",
"description": "Mode d'édition : intelligent (par défaut, portée déterminée automatiquement) ou personnalisé.",
"type": "string",
"enum": [
"customize"
],
"default": "customize"
}
}
}{
"output": {
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "uri",
"description": "URL d'une seule image"
},
"video": {
"type": "string",
"format": "uri",
"description": "URL d'une seule vidéo"
},
"images": {
"type": "array",
"description": "plusieurs URLs d'images",
"items": {
"type": "string",
"format": "uri"
}
},
"videos": {
"type": "array",
"description": "plusieurs URLs de vidéos",
"items": {
"type": "string",
"format": "uri"
}
}
}
}
}RunComfy est la première ComfyUI plateforme, offrant des ComfyUI en ligne environnement et services, ainsi que des workflows ComfyUI proposant des visuels époustouflants. RunComfy propose également AI Models, permettant aux artistes d'utiliser les derniers outils d'IA pour créer des œuvres d'art incroyables.