Lip-Synced Two-Character Dialogue Cartoons

By @mhmazur. Made with Claude Opus 5.5. Watch the original post.

Prompt

How to make a short AI dialogue cartoon with Claude Code or Codex:

You need:
- An ElevenLabs API key with Text to Speech + Voices: Read
- An OpenAI key (gpt-image) for the art
- Optional: an OpenRouter key so Gemini can listen to and check the audio
- ffmpeg, Node, Python, Chrome

Save your keys in files (e.g. ~/.config/elevenlabs/api-key), open Claude Code or Codex in an empty folder (in Codex, allow network access), and paste:

Make me one ~30 second animated dialogue video (1920x1080 MP4).

Characters: [your choice]
Situation: [your choice]
Art style: [your choice]

Write a funny 6-8 line back-and-forth with a punchline. Keys are in ~/.config/*/api-key; never print them.

1. Voices: search the ElevenLabs voice library, audition 3-4 voices per character on a real line, and have Gemini (via OpenRouter) pick the best fit.
2. Speech: eleven_v3 with-timestamps, one request per line, with an acting tag like [exasperated]. Use curl.
3. Audio: trim lines using both the timestamps and the waveform (so nothing is clipped and there's no dead air), fit to 30s, add quiet ambience, and compute a per-frame loudness envelope per character.
4. Art: one 16:9 scene with both characters facing each other, mouths closed. Then one edit per character: "change ONLY their mouth to open mid-word."
5. Mouths: diff each edit against the scene to cut out a feathered mouth overlay.
6. Render: canvas page + Puppeteer + ffmpeg. Show a mouth overlay when that character is loud. Word-synced captions styled to match the art. One fixed shot, both characters always visible, no camera moves, and no black first frame.
7. QA: have Gemini check the audio against the script, fix issues, and check test stills before the full render.

Keep all working files in a source/ folder so it can be re-rendered later.

Browse all 1008 videos