Resize one master ad for every placement, with safe zones
Resize one master ad for every placement: 9:16 for Reels, Stories, TikTok and Shorts, 4:5 and 1:1 for feeds, and 16:9 for YouTube. Your agent copies the master once per aspect ratio, reframes each shot so faces and the product stay in frame, draws the platform's safe zones as guides, moves the text inside them, and exports one named file per size.
This is ordinary ad work for a real product. The agent makes the files. You upload them to each ad platform and switch them on. The agent never publishes an ad.
Use invideo for this when you want every size to stay an editable timeline beside the master, so a change to the copy or a shot is a few edits in each size and a free export.
Quickest path
Set up your agent first with invideo for AI agents. Then give it this prompt with the timeline URL of the master.
Make 9:16, 4:5, 1:1 and 16:9 versions of this ad: <edit-url>.Keep faces and the product in frame, add safe zone guides for Reels andTikTok from their spec pages, move the text inside them, and export eachsize named ad7_9x16_v1, ad7_4x5_v1 and so on. Show me frames of eachsize before you export.Replace <edit-url> with the master's timeline URL, from the editor's address bar. In a chat app, you paste the timeline URL. In a terminal, the agent finds it with invideo project show and saves the frames to a folder.
What you need
The agent needs the master and the list of sizes.
- The timeline URL of the master ad, cut and approved.
- The placements, and the size for each. Common canvases are 1080 by 1920 for 9:16, 1080 by 1350 for 4:5, 1080 by 1080 for 1:1 and 1920 by 1080 for 16:9.
- The safe zone for each placement, from the platform's own page.
- Your naming scheme for the files.
Safe zones in words
A safe zone is the part of the frame that the app's buttons, captions and profile name do not cover. Each platform publishes its own, and it changes, so the agent reads the page on the day.
- Meta Reels and Stories. Keep text, logos and faces off the top, bottom and side edges of a 9:16 ad. With a disclaimer on a Reels ad, Meta asks for more room at the bottom. See About text overlays and the safe zone for ads in Stories and Reels and Best practices for aspect ratios.
- TikTok. The safe zone depends on the orientation and on how long the caption is. TikTok gives safe zone files to download on TikTok Auction In-Feed Ads.
- YouTube Shorts. Google recommends 9:16 vertical video and describes the buttons on the right of the Shorts player on YouTube Shorts ads: asset specs and best practices.
Steps
The agent leaves the master alone and works on copies.
Copy the master once per size
The agent reads the master with
get_timeline, then runsduplicate_timelineonce per size, named like ad7_9x16_v1. It sees one new timeline id per size.Set each canvas
The agent runs
set_timeline_settingson each copy with the width, height and the master'sfps. It sees the new canvas inget_timeline, with the clips now too wide or too tall.Reframe each shot
For each clip, the agent runs
fill_frame, then moves the picture withset_positionso the face or the product sits in the center of the safe area. It usesset_zoomwhere a shot needs to be tighter. It sees each clip's new position.Generate fill for a shot that cannot be cropped
The agent runs
find_modelswith the job in words, picks one, and reads its inputs withget_model. A good pick isltx_2_3_pro.reframe, which fills the new space with generated picture. It callsgeneratewithdry_run: true, the shot's sequence URL asvideoand the newaspect_ratio, and tells you the price. Then it callsgeneratewithmax_creditsset to that price and anidempotency_key. It sees a new sequence URL, reads it withread, and places that shot over the clip withplace_media.Draw the safe zone
The agent adds the safe zone with
create_guide: horizontal guides for the top and bottom bands and vertical guides for the sides, each a fraction of the canvas. It locks them withlocked, so nobody drags them by mistake. It sees the guides inget_timelinemodecollection.Move the text inside the guides
The agent moves each text clip with
set_positionand resizes it withset_text_style. It copies one clip's place to the others withpaste_attributesandtransform. It sees the text inside the guides.Check each size, then export
The agent calls
captureon each copy at the hook, each text and the end card, and runscheck_timeline. Then it runsexportonce per copy withtimeline_id. It sees one export card per size with statuscompleted.
The terminal version, for the 9:16 copy:
invideo agent register <project-url> --name <name>export INVIDEO_AS=<name>invideo edit show <edit-url> --jsoninvideo edit change <edit-url> --timeline T1 --token <state_token> \ --operations @copies.jsoninvideo edit show <edit-url> --jsoninvideo edit change <edit-url> --timeline T2 --token <state_token> \ --operations @9x16.jsoninvideo gen models <project-url> --query "reframe a shot to a new shape"invideo gen model <project-url> --model ltx_2_3_pro.reframeinvideo gen run <page-url> --model ltx_2_3_pro.reframe --dry-run \ -i video=<sequence-url> -i aspect_ratio=9:16invideo gen run <page-url> --model ltx_2_3_pro.reframe \ --max-credits <price> --idempotency-key ad7-c5-9x16 \ -i video=<sequence-url> -i aspect_ratio=9:16invideo edit capture <edit-url> --timeline T2 --at 0.5,4,9,14 \ --out ./frames/9x16invideo edit check <edit-url>invideo edit export <edit-url> --format video --quality 1080 \ --timeline T2 --jsoninvideo status <card-url> --waitinvideo notebook show <card-url> --out ./9x16mv ./9x16/export.mp4 ./9x16/ad7_9x16_v1.mp4Where the values come from:
<edit-url>is the master's timeline URL, and<project-url>is the project it sits in, frominvideo project show.<name>is the name you choose ininvideo agent register.<page-url>is a notebook page frominvideo notebook show <project-url>.<state_token>comes from theinvideo edit showright before each change. After the copies land, the first token is stale.T2is the 9:16 copy's id, from whatduplicate_timelinereturns orinvideo edit show.<sequence-url>is the sequence URL of the shot that cannot be cropped, frominvideo notebook show <project-url>.<price>is the dry run's.estimated_credits.<card-url>is.sequences[0]of what the export returns.invideo statuswaits and does not download;invideo notebook showsaves./9x16/export.mp4.
The file ./9x16.json holds the 9:16 copy as a bare list of operations. On the MCP path, the same list goes in the operations field of edit_timeline. The clip ids come from get_timeline on the copy. The guide positions are an example; take the real ones from the platform's page.
[ { "op": "set_timeline_settings", "timeline": "T2", "width": 1080, "height": 1920, "fps": 30 }, { "op": "fill_frame", "clip": "c3" }, { "op": "set_position", "clip": "c3", "x": -120, "y": 0 }, { "op": "create_guide", "timeline": "T2", "orientation": "horizontal", "position": 0.14, "locked": true }, { "op": "create_guide", "timeline": "T2", "orientation": "horizontal", "position": 0.65, "locked": true }, { "op": "create_guide", "timeline": "T2", "orientation": "vertical", "position": 0.06, "locked": true }, { "op": "create_guide", "timeline": "T2", "orientation": "vertical", "position": 0.94, "locked": true }, { "op": "set_position", "clip": "c9", "x": 0, "y": -300 }]Cost and time
Edits and exports are free. Generation and transcripts cost credits. Paid stock costs a small credit charge, or one of your workspace's iStock licenses. Your agent runs a dry run first and tells you the price before it spends anything.
- Costs credits:
ltx_2_3_pro.reframeon a shot that needs generated fill. It charges by the length of the source. - Free: the copies, the canvas,
fill_frame,set_position,set_zoom, guides,captureand everyexport.
All the sizes take under an hour by hand. See Credits for prices.
If something goes wrong
Most problems are a cropped face or text under the buttons.
| Symptom | Fix |
|---|---|
get_model or generate refuses the model as not found | Models retire. Run find_models with the job in words, use the best match, and tell the person which model you used. |
Exit code 6, or status is held | A safety review, not a refusal. Wait, then run invideo status <url> --wait again. Do not resend. If it ends failed, change the input the review flagged. |
| You want branches instead of copies | Create one branch per size with timeline_history instead of duplicate_timeline. |
| A face is cut at the edge in 9:16 | Move the clip with set_position, or lower the zoom with set_zoom, and capture again. |
fill_frame refused | The clip's zoom is animated. Remove the zoom animation first, or move it by hand. |
| The product leaves the frame halfway through the shot | One position does not fit a moving shot. Split the clip with split_clip and position each part, or use ltx_2_3_pro.reframe. |
| Black bars in the export | A clip is fit, not filled. Run fill_frame on it. |
| Lines show in a capture or the export | Check with get_timeline whether they are guides or a shape clip. Remove guides with delete_guide before the export, and file report_bug. |
| CLI exit 3 | The edit changed since your read. Run invideo edit show and use its new state_token. |
The saved file is called ./9x16/export.mp4 | notebook show always saves ./9x16/export.mp4. Rename it to your scheme. |
| Avoid: one guide set for every platform | Instead: one set per placement, from that platform's page. |
| Avoid: resizing the master | Instead: duplicate_timeline, and resize the copy. |
Prompts to try
Each prompt is a real variation of this job.
The 16:9 master is done. Make only the 9:16 version for TikTok, withTikTok's safe zone for a two-line caption, and export it.The headline changed. Change it in the master and in all four sizes, keepeach size's position, and export version 2 of each.Shot 3 loses the product in 1:1. Price a generative reframe of that shotonly, and wait for my OK.When to use something else
ltx_2_3_pro.reframe fills new space with generated picture. It is not a face-tracking crop. For an automatic crop that follows a face through a long shot, a tool with face tracking, like Auto Reframe in Premiere Pro or Smart Reframe in DaVinci Resolve, fits better. Each platform's ad preview is the final check of the safe zone.