Replace a person in a video
replace_personReplace a person in a video with someone from a picture, keeping the scene, the camera and the moves: put the user into a trend clip, or swap two people for two others. The new video is as long as the video, in whole seconds. To use part of a longer video, make an asset of that part first: download_asset gives its link, and import_asset_url with startSeconds and endSeconds imports only that part. It answers at once with a Job ID and the media is made in the background: start every generation you need, keep working, then call wait_for_jobs with all their Job IDs to get each Asset ID for patch_film. Uses credits for each second of the video: about 48 credits a second at standard and about 64 credits a second at pro, so a 10-second clip uses 478 credits at standard.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Who replaces whom. Call the video @Video1 and the pictures @Image1 to @Image4 in their order: "Replace the man on the left in @Video1 with the person in @Image1, and the woman on the right with the person in @Image2. Keep everything else the same." Up to 2000 characters. | |
| quality | Yes | standard for most videos. pro keeps faces, hands and fine detail sharper, and uses more credits. | |
| keepSound | Yes | null or true (the default) keeps the video's sound, such as the song of a dance trend. false makes the new video silent. | |
| projectId | Yes | The project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs. | |
| references | Yes | 1 to 4 pictures of the people to put in, in this order, each in one of these forms: asset:ID, an image asset as it is; asset:ID#t=14.6, the frame of a video asset at 14.6 seconds; film:#t=3.2, the frame of the edit at 3.2 seconds. Use the IDs search_assets gives. A face and clothes come from the picture. | |
| videoAssetId | Yes | The video to recast: a ready video asset of 3 to 10 seconds, at least 720 pixels on each side. |