{"slug": "raindance-ai-clip-length-pickers-head-swap-vs-whole-person-and-seedance-via", "title": "Raindance AI: Clip-Length Pickers, Head-Swap vs Whole-Person, and Seedance via TryAllAPI", "summary": "A developer built Raindance AI, a timeline-aware video remake product on Cloudflare Workers that lets users pick solo or duet photos, choose head-swap or whole-person modes, and select a 3–10 second moment from a trend clip, with output rendered as MP4 for Shorts and Reels. The Worker routes generation through the TryAllAPI aggregator to Seedance, passing an explicit integer duration on every request because omitting it lets the model choose its own length and causes costs to drift against fixed-price credit packs starting at $5.99. Failed jobs trigger credit refunds, and the developer advises pricing packs only after measuring real runs with retry margin, Stripe fees and refunds included.", "body_md": "*How I shipped a timeline-aware Raindance remake product on Cloudflare Workers — where duration knobs drive Seedance costs through TryAllAPI.*\n\n[raindanceai.app](https://raindanceai.app/?utm_source=devto&utm_medium=blog&utm_campaign=builder) is not “upload and hope.” Users pick **solo (1 photo) or duet (2 photos)**, choose **Head swap** or **Whole person**, then select a **3–10s moment** from the trend clip (including quick Part 1 / 2 / 3 for a full ~30s stitch later in CapCut). Output is an MP4 ready for Shorts/Reels.\n\nThis post focuses on the **API + duration economics** side: why an aggregator, which Seedance knobs matter, and how pricing from **$5.99** maps to credits. Prices and model ids change; treat live site / console as source of truth.\n\nUnlike one-shot 15s party templates, Raindance exposes length:\n\nThat means the Worker must pass **explicit duration** every time. Omitting duration and letting the model “pick a smart length” is how bills drift — and how a $5.99 entry pack silently loses money.\n\nLive pricing seen on the homepage while writing: packs from **$5.99**, with other tiers such as **$9.99** one-video credit messaging and multi-packs (**$23.99** / **$14.99** / **$36.99** variants appear in copy). No subscription required for the core path. Re-check the create CTA before you quote a friend.\n\n| Layer | Choice | Role | \n|---|---|---|\n| Front / SSR | TanStack Start (Vite) | Landing, upload panel, generation status | \n| Runtime | Cloudflare Workers | Edge deploy, secrets, API routes | \n| DB | Cloudflare D1 | Credits, orders, task rows (table prefixes if DBs are shared) | \n| Payments | Stripe Checkout | One-time packs + optional larger packs; guest checkout | \n| Video upstream | TryAllAPI → Seedance | Async create + poll | \n| Analytics | GA | Funnel sanity check | \n\n```\nsolo/duet photos + length + mode\n→ locked Raindance template prompt\n→ check credits (else Stripe)\n→ Worker creates Seedance task via TryAllAPI\n→ poll until MP4 URL → store / show\n→ on failure: refund credits\n```\n\nDemo clips / scene stills are self-hosted with the product. Do not scrape other CDNs for marketing.\n\nDirect vendor onboarding for every video model means accounts, KYC, docs drift, and different async status machines. For a small indie product I wanted one API key in Workers Secrets, USD balance billed by usage, and a path to Seedance without rewriting the client each time the console UI changes.\n\nThat is what [TryAllAPI](https://tryallapi.com/?utm_source=devto&utm_medium=blog&utm_campaign=builder) is for on this project.\n\nOperational checklist after register / top-up:\n\n`raindance-prod` vs sandbox).\n`TRYALLAPI_API_KEY`). Never in the frontend bundle or a blog post.\nConceptually the call shape looks like this (field names follow the aggregator’s v3 contents API; always re-check current docs):\n\n```\nPOST /api/v3/contents/generations/tasks\nAuthorization: Bearer <TRYALLAPI_API_KEY>\nContent-Type: application/json\nAccept-Encoding: identity\n\nGET /api/v3/contents/generations/tasks/{id}\n```\n\nI send `Accept-Encoding: identity` from the Worker because some gateways behave badly with transparent decompression. Model ids used in production look like Seedance 2.x family strings — treat console ids as source of truth, not this paragraph.\n\nA few details that bit me across this family of sites:\n\n`duration` as an explicit integer.`resolution` and `ratio`.` generate_audio`.` queued` → `running` → `succeeded` / `failed`. Success URLs are often `supply_unavailable` or hard failures: refund credits, show a short human message, log the detailed upstream error server-side, optionally fall back to another Seedance tier.\nRough mental model for upstream cost (illustrative only — use your own `usage` fields and invoices):\n\n```\ntokens ≈ duration_sec × width × height × fps / 1024\ncost   ≈ tokens × price_per_million_tokens\n```\n\nPrice the site **after** you measure a few real runs with retry margin, Stripe fees, and failed-job refunds — not from a spreadsheet fantasy of 0% failure.\n\nRaindance-specific:\n\nDemo UIs are easy. The line between toy and product is:\n\n`task_id` in D1.\nTwo books of account stay separate: **USD balance at TryAllAPI** (your cost) vs **site credits** (what you sold). Mixing them in one mental ledger is how you underprice or invent “mysterious” losses.\n\nWhen several products share one Stripe account, isolate webhooks by endpoint or by metadata (`site` / `product`). Callbacks pointed at the wrong apex domain are a classic multi-site footgun.\n\nSecrets stay in Workers: `TRYALLAPI_API_KEY`, `STRIPE_SECRET_KEY`, webhook secret, auth secrets. The browser only ever sees publishable Stripe keys if needed.\n\nRaindance’s lower entry (**from $5.99**) only works if short clips dominate, duration is explicit, and failure refunds are automatic. Measure COGS on 3s vs 10s before locking pack prices.\n\nTypical loop on this template family:\n\n```\npnpm install\n# wire D1 database_id, production env, custom domain in wrangler\npnpm cf:deploy\n```\n\nBefore calling a deploy “done”:\n\n`AUTH_TRUSTED_ORIGINS` and Stripe return / webhook URLs match the production HTTPS origin.\nProduction origin: `https://raindanceai.app`.\n\nFace-based generation is not “just another SaaS CRUD app”:\n\nThose constraints belong in the product, not in a footnote you add after the first dispute email.\n\nConsumer: [raindanceai.app](https://raindanceai.app/?utm_source=devto&utm_medium=blog&utm_campaign=builder). Builder: [TryAllAPI](https://tryallapi.com/register?aff=5A6A&utm_source=devto&utm_medium=blog&utm_campaign=builder), top up, prove create+poll, then wire credits. **Pick the second, bill the second, poll until MP4.**", "url": "https://wpnews.pro/news/raindance-ai-clip-length-pickers-head-swap-vs-whole-person-and-seedance-via", "canonical_source": "https://dev.to/raindance_lab/raindance-ai-clip-length-pickers-head-swap-vs-whole-person-and-seedance-via-tryallapi-2o0k", "published_at": "2026-10-31 05:02:49+00:00", "updated_at": "2026-10-31 05:19:56.874307+00:00", "lang": "en", "topics": ["ai-tools", "generative-ai", "ai-products", "ai-infrastructure"], "entities": ["Raindance AI", "Cloudflare Workers", "TryAllAPI", "Seedance", "Cloudflare D1", "Stripe", "TanStack Start", "CapCut"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/raindance-ai-clip-length-pickers-head-swap-vs-whole-person-and-seedance-via", "markdown": "https://wpnews.pro/news/raindance-ai-clip-length-pickers-head-swap-vs-whole-person-and-seedance-via.md", "text": "https://wpnews.pro/news/raindance-ai-clip-length-pickers-head-swap-vs-whole-person-and-seedance-via.txt", "jsonld": "https://wpnews.pro/news/raindance-ai-clip-length-pickers-head-swap-vs-whole-person-and-seedance-via.jsonld"}}