/media-os:media-lipsync [source] [driver]from media-os
Animates still portraits into talking-head videos and re-syncs video lips to new audio using permissive-license AI models (LivePortrait, LatentSync).
Ships in media-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
scripts/lipsync.py animate --model liveportrait --source face.jpg --driving speech.wav --out talking.mp4 → Step 3.scripts/lipsync.py animate --model liveportrait --source face.jpg --driving actor.mp4 --out retarget.mp4 → Step 3.scripts/lipsync.py sync --model latentsync --video original.mp4 --audio new.wav --out resynced.mp4 → Step 4.scripts/lipsync.py dub --video en.mp4 --new-audio es.wav --out es_dubbed.mp4 → Step 5.scripts/lipsync.py install liveportrait → Step 2.references/LICENSES.md.| Model | License | What it does | Inputs | Output |
|---|---|---|---|---|
| LivePortrait | MIT | Portrait animation: head pose + expression + mouth, from 1 image | 1 still image + (audio OR video) | talking-head video |
| LatentSync | Apache 2.0 | Pure lip-region diffusion on an existing video | 1 video + 1 audio | same video, new lips |
Rule of thumb:
--driving flag that accepts a driving video of ANOTHER face — it retargets that face's expressions onto your still. This is the "deepfake expression transfer" mode; use ethically.Neither model is on PyPI as a drop-in wheel; both are installed by cloning the
reference repo and running their own inference.py. This skill drives those
scripts via subprocess.
uv run .claude/skills/media-lipsync/scripts/lipsync.py install liveportrait
# prints:
# git clone https://github.com/KwaiVGI/LivePortrait ~/LivePortrait
# cd ~/LivePortrait && pip install -r requirements.txt
# (follow README.md section "Download pretrained weights")
uv run .claude/skills/media-lipsync/scripts/lipsync.py install latentsync
# prints:
# git clone https://github.com/bytedance/LatentSync ~/LatentSync
# cd ~/LatentSync && pip install -r requirements.txt
# huggingface-cli download ByteDance/LatentSync --local-dir checkpoints
Check what's present:
uv run .claude/skills/media-lipsync/scripts/lipsync.py check
Set LIVEPORTRAIT_ROOT / LATENTSYNC_ROOT env vars if you installed outside
~/LivePortrait / ~/LatentSync. The script finds them automatically if they
are in the standard location.
All models want a clean face in frame. Preprocess for best results:
ffmpeg -i driver_raw.wav -ar 16000 -ac 1 -c:a pcm_s16le driver.wav
ffmpeg -i source_raw.mp4 -vf "scale=-2:512" -r 25 source.mp4 # LatentSync prefers 25 fps
uv run .../lipsync.py animate \
--model liveportrait \
--source face.jpg \
--driving speech.wav \
--out talking.mp4 \
--fps 25
LivePortrait's audio-driven mode uses an inferred pose/expression sequence from the audio. Movement is subtle — plausible talking-head, not a wild performance.
uv run .../lipsync.py animate \
--model liveportrait \
--source face.jpg \
--driving actor.mp4 \
--out retargeted.mp4
The output preserves the SOURCE's identity, with the DRIVING video's head pose + expression. Ethical note: do not use for impersonation without consent.
uv run .../lipsync.py sync \
--model latentsync \
--video original.mp4 \
--audio new_voice.wav \
--out resynced.mp4 \
--steps 25 --guidance 1.5
LatentSync runs 25-step latent diffusion per lip region. On an H100 it's ~10 seconds of processing per 1 second of video; on a 4090 ~30 seconds per second. CPU-only is not practical.
Combine with media-tts-ai for voice and media-whisper for alignment if needed.
# 1. Generate dubbed audio (media-tts-ai)
uv run .claude/skills/media-tts-ai/scripts/tts.py ... --out dubbed_es.wav
# 2. Re-sync lips
uv run .../lipsync.py dub \
--video source_en.mp4 \
--new-audio dubbed_es.wav \
--model latentsync \
--out final_es.mp4
dub is a thin wrapper around sync with defaults tuned for speech dubbing
(guidance 1.5, 25 steps, strong lip-region weighting).
media-upscale (Real-ESRGAN) if needed.media-interpolate (RIFE).ffmpeg-lut-grade.--video; use LivePortrait for stills.ffmpeg -r 25 for cleanest output.ffmpeg-cut-concat. The script has no built-in chunker — handle in shell.ffmpeg-audio-filter first.media-tts-ai (Kokoro / OpenVoice v2 / CosyVoice 2) to generate a voice, then feed into lipsync.uv run .../lipsync.py animate \
--model liveportrait \
--source ceo_headshot.jpg \
--driving announcement.wav \
--out ceo_speaking.mp4 --fps 25
uv run .../lipsync.py animate \
--model liveportrait \
--source painting_portrait.jpg \
--driving actor_read.mp4 \
--out painting_acting.mp4
# (1) generate Spanish voice via media-tts-ai -> dubbed_es.wav
# (2) re-sync lips:
uv run .../lipsync.py dub \
--video interview_en.mp4 \
--new-audio dubbed_es.wav \
--out interview_es.mp4
uv run .../lipsync.py check
# reports: cuda ok, LivePortrait repo at ~/LivePortrait, LatentSync at ~/LatentSync
uv run .../lipsync.py animate --model liveportrait \
--source face.jpg --driving speech.wav --out out.mp4 \
--dry-run --verbose
# prints the exact `python inference.py ...` command without running it.
LivePortrait repo not foundCause: repo isn't at ~/LivePortrait and LIVEPORTRAIT_ROOT isn't set.
Solution: git clone https://github.com/KwaiVGI/LivePortrait ~/LivePortrait, OR export LIVEPORTRAIT_ROOT=/path/to/LivePortrait.
No module named 'torch' inside inference.pyCause: the LivePortrait / LatentSync venv doesn't have the deps installed.
Solution: cd ~/LivePortrait && pip install -r requirements.txt. The driver does not auto-install.
Cause: LivePortrait reference frame had closed eyes. Solution: pick a source image with eyes open, neutral expression. Do NOT laugh / grimace.
Cause: source video resolution too low, or heavy JPEG compression on the video.
Solution: source at >=512 px short edge, re-encode lossless first (ffmpeg -c:v libx264 -crf 12). Consider upscaling source with media-upscale before LatentSync.
Cause: audio and video clocks drift (VFR source, or audio sample rate mismatch).
Solution: force CFR + 16 kHz audio upfront. ffmpeg -r 25 -i in.mp4 -c:v libx264 -c:a copy fixed.mp4 && ffmpeg -i new.aif -ar 16000 -ac 1 -c:a pcm_s16le new.wav.
Cause: model holds whole video in VRAM.
Solution: split the video into 30-s chunks (ffmpeg-cut-concat segment mode), run LatentSync per chunk, concat the outputs. No built-in chunker in the driver.
Cause: xformers / flash-attn have no MPS path. Solution: run LatentSync on a CUDA machine. On Apple Silicon, only LivePortrait works (audio-driven mode is usable; video-driven mode runs but slow).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
lip-sync, talking-head, liveportrait, latentsync, video-dubbing, ai-animation
110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
npx claudepluginhub damionrashford/media-os --plugin media-osOther plugins' skills for the same job