Edit a video from a description
edit_videoChange what a video shows from a written instruction. The new video keeps the clip's motion, camera, timing and sound, and changes only what you name: a colour ("make her shorts red"), clothes ("turn his shirt into a black hoodie"), an object added, removed or swapped, the background, the weather, the time of day or the season, or the whole look (anime, clay, film noir). With references it puts what the pictures show into the video: a face, an outfit, a product, a logo or a place. Load builtin-generative-video first: it has the prompt rules and says when to use replace_person or copy_motion instead. It edits 3 to 10 seconds of video: a video asset, a part of one (startSeconds and endSeconds), or a group of the film (group), whose clips it edits together as one picture. The new video is as long as what it edited: for a whole asset, play it with the clip's at, offset and duration; for a part, it starts at startSeconds, so play it at offset 0 where that part played; for a group, put it in the group in place of its tracks, at 0, so the group's look and transitions still apply. 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 clip: about 38 credits a second, or about 48 credits a second with references, so a 5-second clip uses 190 credits, or 239 with references.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group | Yes | The id of a <group> in the film to edit as one video, instead of an asset: everything it holds (its cuts, titles and overlays) is drawn together, without the group's own look, and edited as one picture. The group is 3 to 10 seconds long. null with videoAssetId. | |
| prompt | Yes | The change, in one or two plain sentences that name what changes and end with "Keep everything else the same.": "Make her white shorts bright red. Keep everything else the same." With references, call the video @Video1 and the pictures @Image1 to @Image4 by their order: "Replace the face of the man in @Video1 with the face in @Image1. Keep his hair, clothes and everything else the same." Up to 2000 characters. | |
| 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. | |
| endSeconds | Yes | Source second of videoAssetId where the part to edit ends; null for both edits the whole video. | |
| references | Yes | 1 to 4 pictures of what to put in (a face, an outfit, a product, a logo, a place), 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. null when the description says it all. | |
| startSeconds | Yes | Source second of videoAssetId where the part to edit starts, with endSeconds; null for both edits the whole video. Pass the part a clip plays (its offset to offset + duration) instead of importing that part first. | |
| videoAssetId | Yes | The video to edit: a ready video asset. What is edited (the whole video, or startSeconds to endSeconds of it) is 3 to 10 seconds, with references at least 720 pixels on each side. Use the IDs search_assets gives. null with group. |