{"slug": "building-a-focused-ai-video-workflow-for-one-or-two-portraits", "title": "Building a Focused AI Video Workflow for One or Two Portraits", "summary": "A developer built Rumpelstiltskin AI Video, a reference-driven tool that turns one or two uploaded portraits into characters in the original Rumpelstiltskin tiptoe dance video. The system uses an idempotency key on its /api/generate/video route to prevent duplicate paid jobs, submits reference-to-video tasks to Seedance 2.5 via KIE with generate_audio disabled, then merges the original reference audio in a separate step, charging 100 credits at 480P or 170 credits at 720P with automatic credit returns on failure.", "body_md": "When an AI video tool is built around a known reference scene, the input form is part of the product. Users should not have to write a prompt that describes a choreography the system already knows. They should only need to answer one question: which person should appear in each role?\n\nI built [Rumpelstiltskin AI Video](https://airumpelstiltskin.org/) around that idea. It creates a personalized version of the Rumpelstiltskin tiptoe dance video from one or two portraits. The reference scene supplies the dance and camera direction; the uploaded portraits supply the characters.\n\nThe UI has two modes:\n\nThat distinction is more useful than a blank prompt box. It also gives the backend a small, predictable input model: photoMode is either one or two, and the second file is required only in the two-photo mode.\n\nThe API accepts JPG, PNG, and WebP files up to 20 MB each. It also validates the original reference duration, the requested resolution, and the aspect ratio before sending work to the provider.\n\nVideo generation is asynchronous, and users can double-click. The browser creates an idempotency key for each attempt. The /api/generate/video route claims that key before reserving credits, so a repeated request cannot create a second paid job accidentally.\n\nThe response returns a request ID and an IN_QUEUE status. The client then checks /api/generate/video/status and renders the actual state instead of pretending that the video is ready. The visible states are intentionally simple: queued, processing, completed, or failed.\n\nThe server uploads the portrait files and the silent reference video, runs image safety checks, and submits the reference-to-video task to Seedance 2.5 through KIE. The initial provider request uses generate_audio: false. When the video task completes, a separate audio step merges the original reference audio into the result.\n\nThis separation makes failures easier to reason about. A video task can complete while audio finishing is still pending, and each stage has its own status and error handling.\n\nA paid generation uses 100 credits at 480P or 170 credits at 720P. The server checks the user session and available balance, deducts the required amount, and records the generation request before calling the provider.\n\nIf the provider fails or the audio finishing step cannot complete, the failed generation path returns the generation credits automatically. That is a credit return, not a cash refund. The UI says this directly because billing language should match the database behavior.\n\nThe tool does not claim to generate arbitrary videos from arbitrary prompts. It does one reference-driven transformation: your portrait becomes a character in the original tiptoe dance. Users log in, buy a one-time credit pack, choose 480P or 720P, and receive an MP4 download with the original reference audio when processing succeeds.\n\nThat narrow promise affects the whole implementation: the form is short, the validation is strict, the request states are visible, and the pricing copy does not suggest a free or unlimited generator.\n\nIf you want to try the workflow, the product is available at [airumpelstiltskin.org](https://airumpelstiltskin.org/).", "url": "https://wpnews.pro/news/building-a-focused-ai-video-workflow-for-one-or-two-portraits", "canonical_source": "https://dev.to/zhifen_zhu_3df68293e0ddb6/building-a-focused-ai-video-workflow-for-one-or-two-portraits-1nj7", "published_at": "2026-10-10 02:20:27+00:00", "updated_at": "2026-10-10 02:28:58.635168+00:00", "lang": "en", "topics": ["generative-ai", "ai-products", "ai-tools", "ai-agents"], "entities": ["Rumpelstiltskin AI Video", "Seedance 2.5", "KIE"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/building-a-focused-ai-video-workflow-for-one-or-two-portraits", "markdown": "https://wpnews.pro/news/building-a-focused-ai-video-workflow-for-one-or-two-portraits.md", "text": "https://wpnews.pro/news/building-a-focused-ai-video-workflow-for-one-or-two-portraits.txt", "jsonld": "https://wpnews.pro/news/building-a-focused-ai-video-workflow-for-one-or-two-portraits.jsonld"}}