Make a lyric video or text animation for your song
You get a lyric video for your song, also called a karaoke video, a text animation or kinetic typography. Each line of the lyrics builds up word by word as it is sung, and big lines land on the beat. You can make it in one step with lyrical_videos.audio, or line by line on a timeline you can still edit.
Use invideo for this when you want the lyrics timed to your own recording: your agent reads when each word is sung, puts the lines on the timeline, and you can fix a word or move a line after.
Quickest path
Set up your agent first with invideo for AI agents. Then give it this prompt.
Make a lyric video for my song ./song.wav, 16:9. The lyrics are in./lyrics.txt. Show one line at a time, build each line up word by wordas it is sung, and put the chorus lines on the beat. Use my cover art./cover.jpg as the background. Price it first and show me frames.In a chat app, you drag the song, the lyrics and the art into the project's Media panel in invideo. In a terminal, you name the files and the agent uploads them.
What you need
The song is the only thing you must have. The rest makes the result better.
- The song. WAV or MP3, a mix you have the rights to.
- The lyrics as text. The agent checks the timed words against them, so names and slang come out right.
- A background. Your cover art, a clip of the band, stock footage, or a plain color.
- The shape. 16:9 for YouTube, 9:16 for Reels, Shorts and TikTok, 1:1 for a feed.
- The look. Clean, karaoke, bold and moving, or handwritten.
Steps
Your agent edits on a branch and tells you what changed at each step. Steps two and three are the one-step model path. Steps four to six are the timeline path, which you can edit word by word.
Make the timeline and bring in the song and the art
The agent makes a project with
new_project, a timeline withnew_timelinein the shape you asked for, and a branch withtimeline_history. It callsstart_upload, sends the bytes, then callsadd_mediawith theupload_idand the branch URL. Expected result: a sequence URL and a media bin id for the song and the art.Make the lyric video in one step
The agent runs
find_modelswith "lyric video from a song" and reads its pick withget_model. A good pick islyrical_videos.audio. Your agent can search for others withfind_models. It callsgeneratewithdry_run: true, the song asaudio, alyrical_styleofULTRA_BASIC,KARAOKEorPOP_ANIMATION, and anaspect_ratio, and tells you the price. For a price of 1 credit or more it waits for your yes. Then it callsgeneratewithmax_creditsset to that price and anidempotency_key. Expected result: a sequence URL for the finished lyric video, which the agent reads withread.Put the lyrics over your footage in one step
For a video with the song in it, the agent runs
find_modelswith "lyrics over a video" and reads its pick withget_model. A good pick islyrical_videos.video, with the clip asvideoand alyrical_stylesuch asKINETIC_LYRICS,MULTISIZE,PAPER_CUTOUTorSUBTITLE. It callsgeneratewithdry_run: trueand tells you the price. For a price of 1 credit or more it waits for your yes. Then it callsgeneratewithmax_creditsset to that price and anidempotency_key. Expected result: a sequence URL for your footage with the lyrics moving over it, which the agent reads withread.Place the song and the art on the timeline
The agent sends one
edit_timelinecall with twoinsert_mediaops,at_f0 andripplefalse: the song's bin id onA2and the art's bin id onV1. It reads the art clip's end withget_timeline. In a second call, it stretches the art to the song's end withtrim_clipon thetail, and covers the frame withfill_frame. Expected result:captureshows the art and the song starts at frame 0.Time every word
The agent prices
mediaaudio.transcripton the song withdry_run, starts it, and calls again afterretry_after_sfor the words with their times. It checks the words against your lyrics text and keeps your spelling. It runsaudio.beatsfor the beats,audio.markersfor the drops and phrases, andaudio.sectionsfor the chorus. Expected result: each lyric word with a start and end in seconds.Place the lyric lines
The agent adds the lyrics with
add_captions: one slide per line, withwordsinside each slide, so the words of each line build up as they are sung. It turns seconds into frames at the timeline's rate. It sets the font, size and color withset_text_style, and fixes a misheard word withset_caption_slide_text. For big chorus lines, it addsadd_textclips that start on a beat, and moves them withset_keyframesonopacityorrotation. Expected result: the lyrics on the timeline in your style, in time with the song.Check, then export
The agent runs
captureat the first line, a chorus line and the last line, and runscheck_timeline. Then it runsexportwithformatvideo and reads the card. Expected result: each captured line matches the words sung at that time, and the card's status iscompleted.
The same job from a terminal, with the one-step model:
invideo project new --title "Lyric video"invideo agent register <project-url> --name <name>export INVIDEO_AS=<name>invideo edit new <project-url> --name "Lyric video"invideo asset upload <edit-url> ./song.wav ./cover.jpginvideo gen models <project-url> --query "lyric video from a song"invideo gen model <project-url> --model lyrical_videos.audioinvideo gen run <page-url> --model lyrical_videos.audio --dry-run \ -i audio=<sequence-url> -i lyrical_style=KARAOKE \ -i aspect_ratio=16:9invideo gen run <page-url> --model lyrical_videos.audio \ --max-credits <price> --idempotency-key lyric-1 \ -i audio=<sequence-url> \ -i lyrical_style=KARAOKE -i aspect_ratio=16:9invideo status <thread-url> --waitinvideo notebook show <thread-url>Where each value comes from:
<name>is the name you choose ininvideo agent register.INVIDEO_ASpasses it to every later command.<project-url>comes frominvideo project new, and<edit-url>frominvideo edit new.<sequence-url>is theurlthatinvideo asset uploadreturns for the song, a…/notebook/seq-N.MURL.<page-url>is a notebook page of the project, listed byinvideo notebook show <project-url>.<price>is the dry run's.estimated_credits.<thread-url>is theurlthe paidgen runreturns.notebook showon it gives the finished video's sequence URL.
The timeline path from a terminal:
invideo media audio.transcript <sequence-url> --dry-runinvideo media audio.transcript <sequence-url> --max-credits <price>invideo media audio.beats <sequence-url>invideo edit show <edit-url> --jsoninvideo branch new <edit-url> --name lyrics --token <state_token>invideo edit show <branch-url> --jsoninvideo edit change <branch-url> --timeline T1 --token <state_token> \ --operations @ops.jsoninvideo edit capture <branch-url> --at 12,48,95 --out ./framesinvideo edit check <branch-url>invideo edit export <branch-url> --format video --quality 1080 --jsoninvideo status <card-url> --waitinvideo notebook show <card-url> --out ./out<sequence-url> is the song's, as above, and <price> is the dry run's credits. <state_token> comes from invideo edit show <edit-url> for the branch command, then from invideo edit show <branch-url> for edit change. <branch-url> is the .branch_url that invideo branch new returns. ops.json holds a bare JSON list of ops, the operations list of the call below. <card-url> is .sequences[0] of the export result. invideo status waits but saves nothing. invideo notebook show saves the video as ./out/export.mp4, and the agent renames it.
The key MCP call, in full, places the song and the art, then two lines with word timing, and styles them. m1 and m2 are the bin ids that add_media returns for the song and the art. At 30 fps, a word sung at 12.4 seconds starts on frame 372.
{ "url": "<branch-url>", "timeline_id": "T1", "expected_state_token": "<state_token>", "operations": [ { "op": "insert_media", "asset": "m1", "track": "A2", "at_f": 0, "ripple": false }, { "op": "insert_media", "asset": "m2", "track": "V1", "at_f": 0, "ripple": false }, { "op": "add_captions", "track": "V2", "slides": [ { "text": "Hold the light", "start_f": 372, "end_f": 450, "words": [ { "text": "Hold", "start_f": 372, "end_f": 390 }, { "text": "the", "start_f": 390, "end_f": 400 }, { "text": "light", "start_f": 400, "end_f": 450 } ] }, { "text": "till the morning", "start_f": 456, "end_f": 540 } ], "style": { "font_size": 84, "align": "center", "color": "#ffffff" } } ]}<branch-url> is the branch URL that timeline_history returns, and <state_token> comes from get_timeline on it.
A text clip moves as one piece. For each word to move on its own, the agent makes one add_text clip per word.
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.
- Free: the upload, the captions, the text, the checks and the export.
- Tool ops:
audio.beats,audio.markers,audio.sections,audio.separate. The dry run shows its price before anything starts. - Costs credits: a run of
lyrical_videos.audioorlyrical_videos.video, and the transcript of the song. Only the first call spends credits.
The one-step model takes a few minutes to render. The timeline path takes longer to set up, and you can change any word after. See Credits and what they cost for prices.
If something goes wrong
Sung words are harder to hear than speech. Most problems come from a misheard word or a line that shows too early.
| 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. |
| The export has no song, or a black background | The song or the art was never placed. Run the place step: insert_media on A2 and V1. |
invideo status --wait ends and the folder is empty | status does not download. Run invideo notebook show <card-url> --out <dir>. |
| A word in the lyrics is wrong | Fix it with set_caption_slide_text. Words that did not change keep their timing. |
| Lines show before they are sung | The transcript times are in seconds of the song. Check the song starts at frame 0, or add its start to every time. |
| The transcript is missing words in a loud part | Run media audio.separate on the song for the vocal stem, then transcribe the stem. |
audio.transcript returns a status, not words | It is still working. Call it again with the same file after retry_after_s. |
| A line shows a little early or late | The agent moves that slide with move_caption_slide and delta_seconds, or moves one edge with trim_caption_slide. |
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. |
Avoid: running generate again to check on it | Instead: read the thread URL, or run invideo status --wait. |
Prompts to try
Each prompt is a real variation of the job.
Make a 9:16 lyric clip of the chorus of ./song.mp3, from 0:45 to 1:15,for a TikTok teaser. Big bold words, one or two at a time, each onelanding on a beat.Put the lyrics over my band's live video ./live.mp4 in a kinetic style.Price lyrical_videos.video first and show me the styles I can pick.Make a karaoke version: the words of each line in white, building upas they are sung, two lines on screen at once, on a dark blurredversion of my cover art. 16:9.When to use something else
invideo burns the lyrics into the video. For a synced lyrics file on Spotify or Apple Music, submit the lyrics through your distributor or a lyrics service such as Musixmatch. The agent can write the line times out of the caption slides for you.