Use a API RunComfy para executar wan-ai/wan-2-6/flash/image-to-video. Para entradas e saídas aceitas, consulte o esquema.
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/wan-ai/wan-2-6/flash/image-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "A quiet, cinematic two-shot scene in a warm, softly lit bedroom bathroom. Nostalgic, intimate, slightly comedic tone. Photorealistic, shallow depth of field, gentle camera movement. No subtitles.\n\nShot 1 [0–5s]\nContinue from the first frame. Medium two-shot at eye level. Two children sit facing each other in a white bathtub. The girl lifts a small green bar of soap to her mouth like a microphone and whispers as if singing. The boy watches closely, curious and still. Warm tungsten light, cozy bedroom softly visible in the background. Subtle water ripples.\n\nShot 2 [5–10s]\nSlow push-in to a wider side angle revealing more of the room. The girl finishes, lowers the soap, then suddenly laughs. The boy relaxes and smiles back. The tension breaks into quiet laughter. Camera holds steady as the water gently moves. End on a calm, frozen childhood moment.",
"img_url": "https://playgrounds-storage-public.runcomfy.net/tools/7313/media-files/input-1-1.png"
}'Defina a variável de ambiente YOUR_API_TOKEN com sua chave de API (gerenciamento no Perfil) e inclua em cada solicitação um token Bearer no cabeçalho Authorization : Authorization: Bearer $YOUR_API_TOKEN.
Envie um trabalho de geração assíncrono e receba imediatamente um request_id e URLs para status, resultados e cancelamento.
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/wan-ai/wan-2-6/flash/image-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "A quiet, cinematic two-shot scene in a warm, softly lit bedroom bathroom. Nostalgic, intimate, slightly comedic tone. Photorealistic, shallow depth of field, gentle camera movement. No subtitles.\n\nShot 1 [0–5s]\nContinue from the first frame. Medium two-shot at eye level. Two children sit facing each other in a white bathtub. The girl lifts a small green bar of soap to her mouth like a microphone and whispers as if singing. The boy watches closely, curious and still. Warm tungsten light, cozy bedroom softly visible in the background. Subtle water ripples.\n\nShot 2 [5–10s]\nSlow push-in to a wider side angle revealing more of the room. The girl finishes, lowers the soap, then suddenly laughs. The boy relaxes and smiles back. The tension breaks into quiet laughter. Camera holds steady as the water gently moves. End on a calm, frozen childhood moment.",
"img_url": "https://playgrounds-storage-public.runcomfy.net/tools/7313/media-files/input-1-1.png"
}'Obtém o estado atual de um 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>"Obtém as saídas finais e metadados do request_id; se o trabalho não estiver concluído, a resposta retorna o estado atual para continuar o polling.
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/result \
--header "Authorization: Bearer <token>"Cancela um trabalho na fila por request_id; trabalhos em andamento não podem ser cancelados.
curl --request POST \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/cancel \
--header "Authorization: Bearer <token>"Forneça uma URL HTTPS publicamente acessível. O host deve permitir buscas no servidor (sem login/cookies), sem limite de taxa agressivo ou bloqueio de bots. Recomendado: imagens ≤ 50 MB (~4K), vídeos ≤ 100 MB (~2–5 min em 720p). Para ativos privados, URLs estáveis ou pré-assinadas.
{
"type": "object",
"title": "Esquema de entrada",
"required": [
"prompt",
"img_url"
],
"properties": {
"prompt": {
"title": "Prompt",
"description": "O comprimento deve ser inferior a 1.500 caracteres.",
"type": "string",
"default": "A quiet, cinematic two-shot scene in a warm, softly lit bedroom bathroom. Nostalgic, intimate, slightly comedic tone. Photorealistic, shallow depth of field, gentle camera movement. No subtitles.\n\nShot 1 [0–5s]\nContinue from the first frame. Medium two-shot at eye level. Two children sit facing each other in a white bathtub. The girl lifts a small green bar of soap to her mouth like a microphone and whispers as if singing. The boy watches closely, curious and still. Warm tungsten light, cozy bedroom softly visible in the background. Subtle water ripples.\n\nShot 2 [5–10s]\nSlow push-in to a wider side angle revealing more of the room. The girl finishes, lowers the soap, then suddenly laughs. The boy relaxes and smiles back. The tension breaks into quiet laughter. Camera holds steady as the water gently moves. End on a calm, frozen childhood moment."
},
"img_url": {
"title": "Imagem",
"description": "O formato da imagem deve ser: jpg, jpeg, png, bmp, webp. O tamanho do arquivo deve ser inferior a 10 MB.",
"type": "string",
"validations": [
{
"validation_rule": "width_pixels>",
"validation_value": 360,
"validation_error": "A largura e a altura da imagem enviada devem ser superiores a 360 pixels."
},
{
"validation_rule": "height_pixels>",
"validation_value": 360,
"validation_error": "A largura e a altura da imagem enviada devem ser superiores a 360 pixels."
},
{
"validation_rule": "width_pixels<",
"validation_value": 2000,
"validation_error": "A largura e a altura da imagem enviada não podem ultrapassar 2000 pixels."
},
{
"validation_rule": "height_pixels<",
"validation_value": 2000,
"validation_error": "A largura e a altura da imagem enviada não podem ultrapassar 2000 pixels."
}
],
"default": "https://playgrounds-storage-public.runcomfy.net/tools/7313/media-files/input-1-1.png"
},
"audio_url": {
"title": "Áudio",
"description": "O formato de áudio deve ser: wav, mp3. A duração deste áudio deve ser entre 3s e 30s. O tamanho do arquivo deve ser inferior a 15 MB.",
"type": "string"
},
"duration": {
"title": "Duração",
"description": "",
"type": "integer",
"enum": [
5,
10,
15
],
"default": 5
},
"resolution": {
"title": "Resolução",
"description": "",
"type": "string",
"enum": [
"720P",
"1080P"
],
"default": "720P"
},
"shot_type": {
"title": "Tipo de tomada",
"description": "shot_type tem prioridade sobre prompt. Por exemplo, se shot_type for definido como \"single\", o modelo gera um vídeo de uma única tomada mesmo que prompt solicite várias tomadas.",
"type": "string",
"enum": [
"multi",
"single"
],
"default": "multi"
},
"negative_prompt": {
"title": "Prompt negativo",
"description": "",
"type": "string"
},
"seed": {
"title": "Seed",
"description": "",
"type": "integer",
"maximum": 2147483647,
"minimum": 0
},
"prompt_extend": {
"title": "Expandir prompt",
"description": "Define se o prompt de geração de vídeo deve ser expandido automaticamente.",
"type": "boolean",
"default": true
},
"audio": {
"title": "Gerar áudio",
"description": "",
"type": "boolean",
"default": true
}
}
}{
"output": {
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "uri",
"description": "URL de imagem única"
},
"video": {
"type": "string",
"format": "uri",
"description": "URL de vídeo único"
},
"images": {
"type": "array",
"description": "várias URLs de imagem",
"items": {
"type": "string",
"format": "uri"
}
},
"videos": {
"type": "array",
"description": "várias URLs de vídeo",
"items": {
"type": "string",
"format": "uri"
}
}
}
}
}RunComfy é a principal ComfyUI plataforma, oferecendo ComfyUI online ambiente e serviços, juntamente com fluxos de trabalho do ComfyUI apresentando visuais impressionantes. RunComfy também oferece AI Models, permitindo que artistas utilizem as mais recentes ferramentas de AI para criar arte incrível.