H3 Max: recast a person in a take
Give it a source clip and one reference picture per new person; get the same clip with
those people replaced, the performance kept frame for frame and the source's own sound
underneath. It's the route that keeps an actor's exact timing and acting. When the
take itself has to change (new action, new framing), swap the person in the still and
re-animate instead; guide-recast-a-person weighs the two.
Inputs
- The source clip, 5 to 30 s, with no single shot in it over 15 s. Shorter clips are padded (below) and the result trimmed back.
- Reference pictures, 1 to 4, one photo per new person; a product the take should
carry can be one too. Use a single view cut from a character sheet
(
python-split-character-sheet), the front view unless the person is seen from behind. Each must be 256 to 2,048 px a side with an aspect between 0.4 and 2.5: pad with the edge colour, never crop. - Who is recast and who stays, decided with the person before rendering.
Run it
-
Measure the source:
exec ffprobe -v error -show_entries format=duration -of csv=p=0 <job>/shots/shot09.mp4. -
If it is under 5 s, freeze-pad it to 5 s: the last frame held, silence after the sound. With
PAD= 5 − duration + 0.05:exec ffmpeg -v error -y -i <job>/shots/shot09.mp4 \ -vf "tpad=stop_mode=clone:stop_duration=PAD" -af apad -t 5.000 \ -c:v libx264 -crf 14 -pix_fmt yuv420p -c:a aac <job>/recast/shot09_padded.mp4 -
Call
describe("fal/minimax/h3-max/recast")before the first run in a job, then:run("fal/minimax/h3-max/recast", { "video_url": "<job>/recast/shot09_padded.mp4", "reference_image_urls": ["<job>/refs/nora_front.jpg", "<job>/refs/tumbler_hazed.jpg"], "prompt": "<who is recast, who stays; see below>", "resolution": "1080P", "seed": 9100 }, into="<job>/recast/raw", unit="shot09_recast", tag="shot09")resolution:768Por1080P(the default).- Run 2 takes with different seeds (9100, 9101).
enhance_realismexists (default false); untested here.
-
Trim each render back to the source's length plus a 0.5 s tail, keeping the raw one:
exec ffmpeg -v error -y -i <job>/recast/raw/shot09_recast_a.mp4 -t <seconds + 0.5> \ -c:v libx264 -crf 14 -pix_fmt yuv420p -c:a aac <job>/recast/shot09_recast_a.mp4
Prompt
Free text, at most 2,000 characters, no <Subject N> labels: the grammar note and a
worked example are in h3-prompt-format (references/recast.md). The endpoint has no
field for which person to replace, and by default it replaces the main people left to
right, so the prompt must:
- name each person to recast by what the frame shows (wardrobe, position) and say whom they become: "she becomes the woman in reference image 1" (reference image N is the Nth picture sent);
- say who is not recast and keeps their own face, hair and clothes;
- say what else stays: the wardrobe, pose, every movement and its timing, the set, the light, the camera.
What you get
An MP4 of the padded length with the source's sound, the named people replaced. The
untrimmed render stays in raw/.
Tips and traps
- Without a "who stays" sentence, a second person in frame can be recast too.
- The output keeps the source's sound, so a recast person still has the old voice:
re-voicing and lip sync are separate steps (
guide-recast-a-person). - Videos always go up as files, never inline;
runuploads the local path.
Check it
- Watch it beside the source: the same timing and gestures, the right person replaced, the others untouched.
- Look at a frame every 0.75 s for traces of the old person (hair, jewellery, a reflection).
- Confirm the trimmed length (
ffprobe-inspect-media), then a review page.


