Disclosure first: I build Christmas Dance AI, a site that turns photos into short Christmas dance videos. An AI agent drafted this post for me from my commit messages and config; I checked every number before publishing.
This season's Christmas dance trend on TikTok is a duo: two people doing a deadpan routine side by side to "Deck the Halls x Blow the Whistle". My site only did one dancer per video, so I added a two-photo mode. The model call itself was the easy part. Here is what else had to change.
1. The prompt has to pin each face to a side
The duo styles use a reference-video model: it gets the original dance clip plus two photos and copies the motion onto the people in the photos. With two people in frame, the obvious failure is the model swapping the two faces or blending them into one.
The prompt now names each side explicitly:
The dancer on the LEFT side of the frame becomes the person in @Image1 ... The dancer on the RIGHT side of the frame becomes the person in @image2 ... Never swap or blend the two identities.
The UI follows the same rule: photo 1 is the dancer on the left, photo 2 the dancer on the right. A side effect: the two people don't need a photo together, so a couple in different cities can still make the duo.
2. The model returns silent video, so the sound is added afterwards
The trend only works with its sound, but the model output has no audio. After a render lands in storage, the Worker muxes the style's AAC track (cut from the original clip) into the MP4.
I made the music strictly best-effort. If the file is too large to buffer, the track is missing, or muxing throws, the job logs a warning and keeps the silent video. Read and write both use an ETag condition, so if another step rewrote the file in the meantime, the mux gives up instead of overwriting it. A missing soundtrack is annoying; a failed render the user already paid for is worse.
3. Styles needed their own lengths and their own provider
Solo styles offer 6, 12 and 18-second cuts, each from its own trimmed source clip, at 1 credit per second. The duo clips are 14.33 and 15 seconds, and I kept each one as a single full-length option at 18 credits rather than cutting the routine short.
That meant two config changes that sound small. Each style can now define its own duration options, and each style can pin a video provider. The duo styles need a provider that accepts two images; the other providers in the codebase now reject multi-photo jobs outright.
4. Resolution is a pricing decision
Duo videos come out at 480p while solo videos are 720p. The reason is cost: on the provider's published price list, 720p costs about 2.3 times as much per second as 480p (11.7 vs 27.3 cents per second). For a 15-second clip that is roughly $1.76 against $4.10 in model fees, before counting failed renders. I picked 480p to keep that margin.
I state the 480p on the product page, the specs page and the FAQ, because a buyer comparing sites will notice it, and finding out after paying is the worst way to learn it.
5. Phone photos had to be fixed first
A mode that asks for two photos would have made an existing bug twice as likely. Shortly before the duo launch, 7–9 MB phone originals sent to POST /api/uploads were ending in 503 with exceededCpu on the Cloudflare Workers Free plan. The cause: the content-moderation payload was base64-encoded one byte at a time, about 2 seconds of CPU for an 8 MB file.
A pull request co-authored with an outside contributor fixed it in two halves:
- The server converts in 32 KB chunks.
- The browser shrinks any photo over 1.5 MB to a 2048 px JPEG before upload, painting a white background first so transparent PNGs don't turn black.
The same change added checks for photos the model will reject later. The Wan 3.0 reference-image API accepts very narrow or very wide images and then fails upstream with INVALID_PARAM (in the PR's tests 1:2.5 passed; 1:2.7, 1:2.8 and 3:1 failed), so the browser now refuses a photo whose short side is under 300 px or whose long side is more than 2.5 times the short one, and the server checks the image header again and returns 422 if it fails.
6. A second photo is a second piece of personal data
Every job used to have one uploaded photo. Duo jobs store a second one, in a new column. Photo deletion after 7 days, takedown requests and account export all had to learn about that column. If I had only wired the second photo into the generator, it would have stayed in storage after the first one was deleted.
Numbers, for anyone pricing something similar
- A duo render usually takes 8–10 minutes.
- Output: vertical 9:16 MP4 at 480p, 14–15 seconds, no watermark, with the trend sound.
- Price: 18 credits; the $9.90 pack has 18 credits and pack credits don't expire. There is no free render, and you sign in with Google.
- Both people must be adults who agreed to be in the video, and duo videos are for personal, non-commercial posts.
The duo page with samples is here. One more naming note, since people mix them up: christmas-dance.com and aichristmasdance.com are separate sites, not mine.
If you have shipped a multi-person mode on a video model, I'd like to hear how you handled identity swaps.
Top comments (0)