Give your coding agent a song. Get back a beat-synced lyric reel.
No video model needed. Generate images for cents, then animate and render locally.
preview.mp4
| Finished video | How it works |
|---|---|
|
|
| ▶ Watch the 11.5-second MP4 with sound | A pose sheet becomes a dancer, driven by measured beats. |
The bundled example is an 11.5-second retro spaceship dance. Two original human dancers and an articulated mechanical robot perform the original choreography, with the same beat timing and cuts. Separate 3×3 portrait sheets provide face dancing: nods, head tilts and eye changes. The room, planet and starfield are independent layers.
The 34.6-second four-style showcase is also included as an alternate example: paper cut, pixel art, handmade clay and original '80s anime.
Press play above and turn on sound to hear the song and beat-aligned animation. Render the bundled example yourself.
onbeat is a skill for Claude Code and Codex. It teaches your agent to measure the beats and sung words of a song and to write a HyperFrames scene that moves on those times. The result is a vertical 1080×1920 MP4 for Reels, Shorts and TikTok.
A few cents per image instead of dollars per generated video clip. onbeat uses an image model to make the artwork; HyperFrames handles the animation and renders the MP4 locally. You don't need a video-generation model, video credits or a new generated clip for every revision.
For scale, Google's image API pricing lists a 1K Gemini 3.1 Flash Lite image at $0.0336 in output charges. Its published Veo 3 video rate is $0.40 per second: roughly 3 cents for an image versus $3.20 for an eight-second clip. These are illustrative generation prices, not the total cost of this showcase. More artwork and retries cost more; model choice, input charges, coding-agent usage and local computing also affect the total.
Generate the artwork once. Animate it as many times as you like.
The dancers are sprite sheets, not generated video clips. An image model draws 16 body poses per character and, for face dancing, a separate sheet of nine close-up poses. onbeat then steps through those drawings on beats measured from the song, layers them with scenery, and renders the result locally with HyperFrames. The same character art stays consistent across every scene, and the motion clock stays tied to the music.
This is where the cost advantage comes from: changing the timing, swapping a background, moving a dancer, editing the lyrics or re-rendering existing artwork requires zero additional image or video generation calls. You can switch between styles, cut from body animation to face animation and revise the choreography without generating a new video clip for every scene or revision. Local renders still use your computer; making new artwork may use provider credits.
| What changes | With onbeat's reusable artwork |
|---|---|
| A move lands late | Adjust the measured timing or choreography and render again. |
| The scene needs more depth | Move the background, dancers and foreground props independently. |
| Another style joins the cast | Add its pose sheet; keep the existing cast and timing. |
| The lyrics, layout or cut needs revision | Edit the scene and render again with the same images. |
Getting several consistent characters, precise beat timing and matching scene changes from generated video can take repeated paid clip generations. onbeat makes those choices explicit in code, so revising the animation with existing artwork adds no image- or video-generation charge.
The tradeoff is deliberate: this looks like assembled, pose-based animation. It is built for rhythmic dancing and stylized worlds; it does not simulate continuous cinematic character motion.
Any agent, one command (skills.sh)
npx skills add latent-spaces/onbeatIt asks which agents to install for (Claude Code, Codex and others) and copies the skill into your project. Add -g to install it for all projects.
Claude Code plugin
/plugin marketplace add latent-spaces/onbeat
/plugin install onbeat@onbeat
Codex plugin
codex plugin marketplace add latent-spaces/onbeat
codex plugin add onbeat@onbeatOr copy the skills/onbeat folder into your agent's skills folder. It is self-contained.
Ask in plain words:
Render the onbeat example.
Make a beat-synced reel for ~/Downloads/my-song.mp3. Neon city at night, karaoke lyrics.
The agent measures the song, then works with you on the concept and a simple story. Supply reference images if you have them: they can guide the actual character/style or provide context. You choose between rough visual directions before production assets are made. A short dancing draft comes next; you review it with sound, then the agent iterates and extends the agreed direction into the full reel.
Higgsfield and Codex's built-in image generator are the main image routes. In Codex, the built-in generator is the default. Dancing avatars keep the character design you approved; friends can join on measured bar downbeats.
The example renders by itself. You need Node 22+ and ffmpeg, and no keys or accounts.
git clone https://github.com/latent-spaces/onbeat && cd onbeat/skills/onbeat/examplenpx --yes hyperframes@0.9.2 render --output out/example.mp4The first render downloads HyperFrames and a headless browser once.
song.mp3 ──► timing.py ──► timing.js ──► the scene your agent writes ──► HyperFrames ──► reel.mp4
There are two clocks, both measured from the audio. The beat clock drives the pulses, cuts and dance poses. The voice clock drives the lyrics. Every frame is a pure function of the song time, so a render comes out the same every time.
The design of each scene is left to the agent, so the reels get better as models do. The measuring is code, because a model can't hear the beat.
skills/onbeat/
SKILL.md the method: measure, write one scene, check the sync, render
references/ render rules, beat motion, character sprites
scripts/ timing.py (beats, bars, words) and sprites.py (checks character sheets)
example/ the 11.5-second spaceship dance to copy and rewrite
examples/ the alternate 34.6-second four-style showcase
Both examples include the original cast, separate scenery layers, source artwork and prompts. No image- or video-generation account is needed to render them.
The agent reads your audio/reference files, writes a reel folder and runs local analysis and rendering commands. Rendering needs Node 22+ and ffmpeg; beat analysis adds a Python environment with the pinned dependencies in scripts/requirements.txt. Optional word alignment uses a separate Python 3.12 environment and large local speech/separation models. First use downloads packages, a headless browser, models and potentially fonts; the audio-analysis scripts themselves run locally. Your coding agent's data handling depends on its provider and settings. Image generation sends prompts and supplied reference images to the selected provider and may use credits. The skill asks before paid generation and does not publish your reel. Details are in PRIVACY.md.
The beat tracker assumes one fixed tempo and defaults to four beats per bar. Kick-based downbeat/section detection suits a clear regular drum pulse; changing tempo, unusual meters, weak percussion and expressive vocals need closer review. Word recognition and alignment can miss or mishear lyrics, so inspect the sync overlay and disclose estimated words. A visual review is not an independent numeric proof of beat accuracy.
Run node --test tests/ for the helper regressions and bash skills/onbeat/scripts/smoke.sh for a scratch-copy check, render and MP4 probe.
This is an early release (v0.2). The bundled example and helper tests pass. An assisted unfamiliar-song session exercised concept choices, reference-led character graphics, a short three-character dancing draft and a visual revision. It required intervention, so it is not an unedited first-try result. Clean installs from GitHub were checked for the Claude Code plugin, the Codex plugin and npx skills add; from the clean Claude Code install, a headless agent rendered the example unaided. A fresh word-alignment install, broad genre coverage, independent repeatability and a controlled with/without-OnBeat comparison remain unverified. The Higgsfield sprite route only prints its commands.
- MIT licence. See LICENSE. Third-party components retain their own licences.
- The sprite-sheet approach is adapted from page-mascot by Kamran Ahmed (MIT). See THIRD_PARTY_NOTICES.md.
- HyperFrames by HeyGen renders the video and GSAP drives the timeline. Word alignment uses WhisperX, faster-whisper and Demucs.
- The song "allow always" was made with Suno by the repo owner.
