Scene Director
The user requests a video; the agent creates the opening frame, the closing frame, and renders the clip interpolating between the two — with async job and progress in the conversation.
Updated on Sep 02, 2026
The request is simple — "I want a video of a puppy waking up and looking at the camera" — and the result is a clip with narrative: the agent decides what exists at the beginning and end of the scene, generates both images, and sends the video model to interpolate the movement between them.
The technical trick is the first/last frame mode of /v1/videos (images: [initial, final]), combined with async mode ("async": true): the route responds immediately with a job_id, the agent reports progress and polls the result — nothing hangs waiting for the ~2 minutes of rendering.
Cost per clip
In the example settings: 2 images (flux-2-dev, ~$0.03 each) + 5s of video (seedance-2.0-mini, ~$0.58) ≈ $0.64 per clip. The prompt instructs the agent to confirm before generating multiple.
How to import
On the platform: Agents → Import, choose the downloaded file. It enters as a new draft (nothing existing is changed), with renewed observability ids. Then fill in what belongs to your environment — credentials, URLs, and knowledge bases — and publish.
{
"format": "hinow.agent",
"version": 1,
"exported_at": "2026-09-01T00:00:00Z",
"credentials_included": false,
"agent": {
"name": "Diretor de cena",
"description": "O usuário pede um vídeo; o agente cria o quadro inicial, o quadro final e renderiza o clipe interpolando entre os dois — job assíncrono, com progresso na conversa.",
"avatar": null,
"model": null,
"system_prompt": null,
"config": {},
"tools": null,
"workflow": {
"nodes": [
{
"id": "start",
"type": "start",
"position": {
"x": 300,
"y": 0
},
"data": {
"label": "Início",
"variables": []
}
},
{
"id": "agent-1",
"type": "agent",
"position": {
"x": 290,
"y": 160
},
"data": {
"name": "diretor",
"model": "hinow/himax",
"system_prompt": "Você é um diretor de cena: transforma um pedido de vídeo em um clipe curto com narrativa.\n\nO MÉTODO (siga sempre, avisando o usuário a cada etapa)\n1. Entenda a cena: o que existe no COMEÇO e o que existe no FIM. Se o pedido não deixar claro, proponha você mesmo um começo e um fim em uma frase e siga.\n2. Diga \"🎬 Criando o quadro inicial...\" e chame gerar_imagem com um prompt visual rico EM INGLÊS do primeiro quadro (cena, luz, enquadramento, estilo). Use model=black-forest-labs/flux-2-dev e n=1.\n3. Diga \"🎬 Agora o quadro final...\" e gere o último quadro com o MESMO cenário, mesma luz e mesmo enquadramento — só o que a narrativa muda deve mudar.\n4. Mostre as duas imagens (markdown de imagem) e chame gerar_video com: model=bytedance/seedance-2.0-mini, images=[url_inicial, url_final] NESTA ORDEM, duration=5 e um prompt EM INGLÊS do MOVIMENTO entre os quadros. Ela responde NA HORA com um job_id — o vídeo continua sendo renderizado no servidor.\n5. Avise: \"🎬 Vídeo em renderização (~2 minutos)...\" e consulte consultar_video com o job_id. Se status for queued/running, consulte no máximo mais 3 vezes; se ainda não tiver terminado, ESCREVA O CÓDIGO DO JOB NA SUA MENSAGEM (ex.: `job: 8370e7b8-…`, o id completo) e diga que o usuário pode perguntar \"e aí?\" em um instante. IMPORTANTE: só o que você escreve fica na conversa — na próxima mensagem, retome o job pelo código que VOCÊ anotou, nunca invente um.\n6. Quando status=succeeded, entregue a URL do mp4 exatamente como veio em result.urls[0] e descreva a cena em uma frase.\n\nREGRAS\n- URLs sempre exatamente como as ferramentas devolveram — nunca invente nem encurte.\n- Os dois quadros devem parecer o mesmo lugar: repita cenário, paleta e enquadramento nos dois prompts.\n- Se uma etapa falhar, diga qual foi e o erro — não repita mais de uma vez sem avisar.\n- Um vídeo por pedido. Custo aproximado: US$ 0,70 por clipe — se pedirem vários, confirme antes.",
"config": {
"temperature": 0.6,
"max_tool_loops": 12
}
}
},
{
"id": "hook-1",
"type": "webhook",
"position": {
"x": 575,
"y": 160
},
"data": {
"label": "HINOW mídia",
"config": {
"name": "HINOW mídia",
"baseUrl": "https://api.hinow.ai/v1",
"timeout": 30000,
"auth": {
"type": "bearer",
"token": "COLE_SUA_API_KEY_hi"
},
"retryOnError": false,
"maxRetries": 0,
"routes": [
{
"id": "r1",
"name": "gerar_imagem",
"method": "POST",
"path": "/images",
"description": "Gera uma imagem a partir de um prompt e devolve a URL pública.",
"whenToUse": "Para criar o quadro inicial e o quadro final da cena.",
"responseDescription": "data.urls[0] é a URL pública da imagem. data.cost.amount é o custo.",
"bodyTemplate": "{\"model\": \"{{model}}\", \"prompt\": \"{{prompt}}\", \"n\": {{n}}}",
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"description": "Modelo de imagem",
"example": "black-forest-labs/flux-2-dev"
},
{
"name": "prompt",
"type": "string",
"required": true,
"description": "Descrição visual detalhada, em inglês"
},
{
"name": "n",
"type": "number",
"required": true,
"description": "Quantas imagens. Sempre 1",
"example": "1"
}
],
"enabled": true
},
{
"id": "r2",
"name": "gerar_video",
"method": "POST",
"path": "/videos",
"description": "Inicia a renderização do vídeo interpolando do primeiro ao último quadro. Responde na hora com um job_id.",
"whenToUse": "Depois de ter as DUAS imagens prontas. images[0]=quadro inicial, images[1]=quadro final. Depois acompanhe com consultar_video.",
"responseDescription": "202 com data.job_id e data.poll_url. A renderização continua no servidor.",
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"description": "Modelo de vídeo",
"example": "bytedance/seedance-2.0-mini"
},
{
"name": "prompt",
"type": "string",
"required": true,
"description": "O movimento entre os quadros, em inglês"
},
{
"name": "images",
"type": "array",
"required": true,
"description": "[url_quadro_inicial, url_quadro_final], nesta ordem",
"howToObtain": "As URLs devolvidas por gerar_imagem"
},
{
"name": "duration",
"type": "number",
"required": true,
"description": "Segundos de vídeo. Use 5",
"example": "5"
}
],
"enabled": true,
"bodyTemplate": "{\"model\": \"{{model}}\", \"prompt\": \"{{prompt}}\", \"images\": \"{{images}}\", \"image_mode\": \"frames\", \"duration\": {{duration}}, \"async\": true}"
},
{
"id": "r3",
"name": "consultar_video",
"method": "GET",
"path": "/media/jobs/{{job_id}}",
"description": "Consulta o andamento da renderização do vídeo.",
"whenToUse": "Depois de gerar_video, com o job_id devolvido. Repita enquanto status for queued/running (máx. 4 por turno).",
"responseDescription": "data.status: queued | running | succeeded | failed. Quando succeeded, data.result.urls[0] é o mp4 e data.result.cost o custo.",
"parameters": [
{
"name": "job_id",
"type": "string",
"required": true,
"description": "Id do job",
"howToObtain": "Veio da resposta de gerar_video",
"example": "7796d83b-..."
}
],
"enabled": true
}
]
}
}
},
{
"id": "end-1",
"type": "end",
"position": {
"x": 305,
"y": 330
},
"data": {
"label": "Fim",
"status": "success"
}
}
],
"edges": [
{
"id": "e1",
"source": "start",
"target": "agent-1"
},
{
"id": "e2",
"source": "hook-1",
"target": "agent-1",
"sourceHandle": "tool",
"targetHandle": "slot-1"
},
{
"id": "e3",
"source": "agent-1",
"target": "end-1"
}
]
}
}
}| Card | Why it's here | What it does |
|---|---|---|
**Agent director** | The screenwriter. | Transforms the request into two visual prompts IN ENGLISH with the same scene/lighting/framing (only the narrative changes), and describes the MOVEMENT between frames for the video model. |
| **Webhook → api.hinow.ai** (3 routes) | HINOW's own API as a tool. | generate_image (POST /images), generate_video (POST /videos with async: true), and query_video (GET /media/jobs/{{job_id}}). Bearer = your hi_... key. |
- 1
Generates both frames and shows them
The user sees the images before the video — and can correct the scene cheaply, without paying for rendering.
- 2
Fires the video and receives the job immediately
generate_videowithimages:[initial, final]and"async": trueresponds in milliseconds withjob_id+poll_url. - 3
Polls a few times and, if needed, defers
Up to 3 polls in the turn; if still rendering, the agent writes the job code in the message and invites the user to ask "how's it going?".
- 4
The "how's it going?" resumes by code
The conversation continues in the same
thread_id; the agent rereads the annotated job, polls again, and delivers the mp4 URL exactly as it came back.
Why annotate the job in the message
The thread history stores the text of the conversation — not tool results. An id that only existed in a tool return doesn't survive the turn; written in the message, it survives. It's the golden rule of any async flow in conversation.
- Paste your
hi_...key in the card'sauth.token(the file comes with a placeholder). - Quality over cost: swap the models in the system prompts —
seedream-5-litefor images andveo-31for video change the tier (and the price). - Longer clip:
durationup to the model's limit; the async job handles long renders (35 min deadline). - No narrative, just animate a photo: send a single image in
images— becomes simple image-to-video.

