One photo + a speech clip → a lip-synced talking-head video. Real time on Apple silicon (macOS 14 or later; M4 Pro, M3 Pro) and on an RTX 3050 Ti laptop GPU with TensorRT (40 ms/frame, just 25 fps); 168-169 MB per platform. Built and evaluated for Nepali and English.
Code: github.com/Ampixa/talkinghead · Try it in your browser: ampixa.com/talkinghead
pip install "git+https://github.com/Ampixa/talkinghead.git" # Apple silicon / CPU
pip install "ampixa-talkinghead[tensorrt] @ git+https://github.com/Ampixa/talkinghead.git" # NVIDIA
from ampixa_talkinghead import Avatar
Avatar("photo.jpg").speak("speech.wav", "out.mp4")
The Core ML packages require macOS 14 or later. On macOS 14 the decoder skips the Neural Engine after its built-in accuracy check and uses the GPU, because the Neural Engine output is incorrect on that OS release.
| Render loop, Apple M4 Pro (Core ML) | 36.5 ms/frame (≈27 fps) |
| Render loop, Apple M3 Pro (Core ML) | 39.9 ms/frame (25 fps) |
| Render loop, RTX 3050 Ti laptop (TensorRT) | 40.0-40.5 ms/frame (25 fps; networks alone 25.7 ms) |
| Download per machine | 169 MB (Apple silicon), 168 MB (NVIDIA) |
| Peak memory | ~1.7 GB during speak() |
| Lip sync | close to Ditto, not equal: an earlier full-quality build scored SyncNet LSE-C 5.23 vs Ditto's 5.31 (15 Nepali + English cases); the real-time renderer shipped here scored 0.51 lower than Ditto on a 7-case gate. Details: GitHub README |
| folder | what | used on |
|---|---|---|
common/ |
face setup, audio and motion models | every platform |
coreml/ |
real-time renderer | Apple silicon |
onnx/ |
real-time renderer (TensorRT engines are built on first use) | NVIDIA |
realtime/ |
real-time renderer, PyTorch | fallback |
full/ |
full-quality renderer, PyTorch | offline / CPU |
web/ |
every network as ONNX for onnxruntime-web (WebGPU) | the browser demo |
The library downloads only the folders your machine needs. MANIFEST.json lists every file with its sha256.
ampixa.com/talkinghead runs the whole pipeline on the visitor's own GPU (WebGPU):
the models in web/ download from this repo once, and nothing is uploaded. It is not real time in a browser:
about 245 ms per frame on an M4 Pro (a 10 s clip takes about a minute), because a browser cannot use the Neural Engine
that the native Core ML path uses. Lip sync matches the Python package (SyncNet LSE-C on the same inputs: 5.66 vs 5.44,
4.54 vs 4.63). Needs a recent Chrome or Edge (WebGPU, WebCodecs, JSPI).
Paintings (public domain) with voices from sanoTTS; people from the
package's examples/ speaking Nepali and English (FLEURS, CC BY 4.0).
Photo credits (Wikimedia Commons): face04 Bibek Raut (CC BY-SA 4.0), face05 MaximusPrasad (CC BY-SA 4.0), face06 Nithi Anand (CC BY 2.0), face13 Dr. Hans-Günter Wagner (CC BY-SA 2.0), face15 Jeremy Bishop (CC0). Demo videos made from CC BY-SA photos are shared under CC BY-SA.
Apache-2.0. Derived from Ditto (Apache-2.0) and LivePortrait /
S2G-MDDiffusion (MIT); see NOTICE in the code repository. The face crop uses MediaPipe (Apache-2.0).
full/decoder.pth 106 MiBrealtime/renderer.pt 54 MiBweb/lmdm.onnx 37 MiBcommon/lmdm_student.pt 37 MiBcommon/hubert_student.pt 35 MiBweb/hubert_body.onnx 34 MiBweb/motion_extractor.onnx 31 MiBonnx/decoder_b4.onnx 30 MiBweb/decoder.onnx 30 MiBcoreml/decoder.mlpackage/Data/com.apple.CoreML/weights/weight.bin 30 MiBcommon/motion_extractor.pth 27 MiBcoreml/warp.mlpackage/Data/com.apple.CoreML/weights/weight.bin 25 MiBweb/warp.onnx 24 MiBonnx/warp_b1.onnx 24 MiBfull/warp_student.pt 24 MiBweb/appearance.onnx 3 MiBcommon/stitch_network.pth 2 MiBcommon/appearance_extractor.pth 2 MiBweb/hubert_out.onnx 1 MiBcoreml/decoder_ref.npz 900.7 KiBweb/stitch.onnx 188 KiBcommon/defaults.npz 24.2 KiB