Image-to-Video
Core ML
ONNX
TensorRT
Nepali
English
ampixa-talkinghead
talking-head
lip-sync
audio-driven
webgpu
Run this model with HF Jobs
Run ampixa/talkinghead on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ampixa/talkinghead. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ampixa/talkinghead on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use ampixa/talkinghead with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use ampixa/talkinghead with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Public release: ampixa-talkinghead weights (Core ML, TensorRT ONNX, PyTorch) + browser models (web/)
Browse filesFiles changed (42)
- .gitattributes+10
- LICENSEAdded+201
- MANIFEST.jsonAdded+158
- NOTICEAdded+66
- README.mdAdded+86
- common/appearance_extractor.pthAdded+3
- common/defaults.jsonAdded+209
- common/defaults.npzAdded+3
- common/face_landmarker.taskAdded+3
- common/hubert_student.ptAdded+3
- common/lmdm_student.ptAdded+3
- common/motion_extractor.pthAdded+3
- common/stitch_network.pthAdded+3
- coreml/decoder.mlpackage/Data/com.apple.CoreML/model.mlmodelAdded+3
- coreml/decoder.mlpackage/Data/com.apple.CoreML/weights/weight.binAdded+3
- coreml/decoder.mlpackage/Manifest.jsonAdded+18
- coreml/decoder_ref.npzAdded+3
- coreml/warp.mlpackage/Data/com.apple.CoreML/model.mlmodelAdded+3
- coreml/warp.mlpackage/Data/com.apple.CoreML/weights/weight.binAdded+3
- coreml/warp.mlpackage/Manifest.jsonAdded+18
- demo/clips/01_monalisa.mp4Added+3
- demo/clips/02_napoleon.mp4Added+3
- demo/clips/03_pearl.mp4Added+3
- demo/clips/04_face06_nepali_female_2.mp4Added+3
- demo/clips/05_face15_english_male_2.mp4Added+3
- demo/clips/06_face04_nepali_male_1.mp4Added+3
- demo/clips/07_face13_english_male_1.mp4Added+3
- demo/clips/08_face05_nepali_female_1.mp4Added+3
- demo/hero.mp4Added+3
- full/decoder.pthAdded+3
- full/warp_student.ptAdded+3
- onnx/decoder_b4.onnxAdded+3
- onnx/warp_b1.onnxAdded+3
- realtime/renderer.ptAdded+3
- web/appearance.onnxAdded+3
- web/decoder.onnxAdded+3
- web/hubert_body.onnxAdded+3
- web/hubert_out.onnxAdded+3
- web/lmdm.onnxAdded+3
- web/motion_extractor.onnxAdded+3
- web/stitch.onnxAdded+3
- web/warp.onnxAdded+3
32 unmodified lines3334353637383940414243444532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textcommon/face_landmarker.task filter=lfs diff=lfs merge=lfs -textdemo/clips/01_monalisa.mp4 filter=lfs diff=lfs merge=lfs -textdemo/clips/02_napoleon.mp4 filter=lfs diff=lfs merge=lfs -textdemo/clips/03_pearl.mp4 filter=lfs diff=lfs merge=lfs -textdemo/clips/04_face06_nepali_female_2.mp4 filter=lfs diff=lfs merge=lfs -textdemo/clips/05_face15_english_male_2.mp4 filter=lfs diff=lfs merge=lfs -textdemo/clips/06_face04_nepali_male_1.mp4 filter=lfs diff=lfs merge=lfs -textdemo/clips/07_face13_english_male_1.mp4 filter=lfs diff=lfs merge=lfs -textdemo/clips/08_face05_nepali_female_1.mp4 filter=lfs diff=lfs merge=lfs -textdemo/hero.mp4 filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158{ "total_bytes": 586585899, "tier_bytes": { "common": 111400930, "coreml": 57821209, "full": 136343226, "onnx": 56707590, "realtime": 56398816, "web": 167914128 }, "files": [ { "file": "common/appearance_extractor.pth", "bytes": 1710182, "sha256": "b21fb83a6c26dc6236046332f42493c3010d4ba9fa13075b71e81430faf26f77", "source": "research:release/ditto_small_v1/models/appearance_extractor.pth" }, { "file": "common/defaults.json", "bytes": 3175, "sha256": "29b34cb72dbfef8278863f91a2b400dcf80a9c77bebcfbe0f04e98933245c530", "source": "research:checkpoints/ditto_cfg/v0.4_hubert_cfg_pytorch_cpu.pkl (default_kwargs)" }, { "file": "common/defaults.npz", "bytes": 24830, "sha256": "a3782863b8a9137b609bda20c522c836c1e8a3cdc6d5207a420849cd4e22439f", "source": "research:checkpoints/ditto_cfg/v0.4_hubert_cfg_pytorch_cpu.pkl (default_kwargs)" }, { "file": "common/face_landmarker.task", "bytes": 3758596, "sha256": "64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff", "source": "research:release/ditto_small_v1/aux_models/face_landmarker.task" }, { "file": "common/hubert_student.pt", "bytes": 36263525, "sha256": "36c37fe70fb05ff0d9e67f593369424b3d1d91abb55764950d4be9b7640cf8c3", "source": "research:release/ditto_small_v1/students/hubert_student.pt" }, { "file": "common/lmdm_student.pt", "bytes": 38846535, "sha256": "a9b5515bc5e71fa44f4c979ba0ce770ee5306f95e3a3fa1a34395073cccf08c5", "source": "research:release/ditto_small_v1/students/lmdm_student.pt" }, { "file": "common/motion_extractor.pth", "bytes": 28401722, "sha256": "7fa353a482119139f17c23a2a671ae0a27e5e80760f2ea497e00d13f82755914", "source": "research:release/ditto_small_v1/models/motion_extractor.pth" }, { "file": "common/stitch_network.pth", "bytes": 2392365, "sha256": "f15e41dbd13226d1cff13317fb8f80350d246d04019e8784fe309c2cf7d0306c", "source": "research:release/ditto_small_v1/models/stitch_network.pth" }, { "file": "coreml/decoder.mlpackage", "bytes": 31120174, "sha256": "2f81cc4108d5b0f3e08bccc2696498008558e9ec3a7f7d703b87ec562192aac2", "source": "tools/export_coreml.py decoder --ckpt research:runs/students/slim512_sync/best.pt --precision fp16" }, { "file": "coreml/decoder_ref.npz", "bytes": 922295, "sha256": "61008f528c09373ba9da7edfab567422d1166dcd64316c2ae58e9c633848a2f0", "source": "computed from research:runs/students/slim512_sync/best.pt (fp32 decoder, input rng seed 0)" }, { "file": "coreml/warp.mlpackage", "bytes": 25778740, "sha256": "cd319c62e940cb7ba1db6530ccf08f5f29dfc3d182fe2edc11b6eff1cd7eb76e", "source": "tools/export_coreml.py warp --ckpt research:runs/students/slim512_sync/best.pt --precision warp_coordinates" }, { "file": "full/decoder.pth", "bytes": 110932691, "sha256": "2d5dd8a9a86f8564f2a3d8fb050c1364b2ce852501598944dee85a0d1d633332", "source": "research:release/ditto_small_v1/models/decoder.pth" }, { "file": "full/warp_student.pt", "bytes": 25410535, "sha256": "2a65f22ff51a55e91d7b22b0358e8fa712fefe741fcd6d3966f434ba4a1bf98d", "source": "research:release/ditto_small_v1/students/warp_student.pt" }, { "file": "onnx/decoder_b4.onnx", "bytes": 31206092, "sha256": "16cc373400a0c3f5e114dee8ab9d08acd14d7ce95bb31ce9b57eefba4d8a9df4", "source": "tools/export_onnx.py decoder --ckpt research:runs/students/slim512_sync/best.pt --batch 4 --fp16" }, { "file": "onnx/warp_b1.onnx", "bytes": 25501498, "sha256": "edaec6024525e993ff0f02d20dee9350c272f1754437490b3b3d35f20a02b995", "source": "tools/export_onnx.py warp --ckpt research:runs/students/slim512_sync/best.pt --batch 1 --fp16" }, { "file": "realtime/renderer.pt", "bytes": 56398816, "sha256": "1da60e74e272d136b49669bc2db0c8c42530118a9287584985db8b5426f02b4e", "source": "research:runs/students/slim512_sync/best.pt" }, { "file": "web/appearance.onnx", "bytes": 2759816, "sha256": "c8e773cfde912cf852f7737c3ccf727a9af4c57da5eee8e8a75add11935f2401", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" }, { "file": "web/decoder.onnx", "bytes": 31097525, "sha256": "f5a6d96bf239bcc866c80055df2450be39233d28f677b8e33a917886fa286541", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" }, { "file": "web/hubert_body.onnx", "bytes": 35284216, "sha256": "d80ed0c8f61f47567ceddd7a1cb974b55abf5a9d35a789fe1a5aca3043d550d0", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" }, { "file": "web/hubert_out.onnx", "bytes": 1055323, "sha256": "1879b5c379f0de22596f8efd5f5edc89895baf634f2c369f328f621865b2f2a9", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" }, { "file": "web/lmdm.onnx", "bytes": 39069985, "sha256": "faa3d8d777f87c2c378862e26230581951289c8329c01ea8d8b3fcdf95b5ab5c", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" }, { "file": "web/motion_extractor.onnx", "bytes": 32951664, "sha256": "346ad6bf7b8cd83b246db9813674934595c71bb6b895fbb7ee63f72bda5f0d7c", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" }, { "file": "web/stitch.onnx", "bytes": 192562, "sha256": "6a1bca1fb68dce95ab665b071540b20feb46045d84ebd1a7c4c0c6786cc975d3", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" }, { "file": "web/warp.onnx", "bytes": 25503037, "sha256": "3dd0f1475e1c101b9f4085d65d7fb7e859830e7f7bb3358c0b20f8f9fcf32f31", "source": "browser build: ampixa-talkinghead-web export/export_nets.py + compress_weights.py (onnxruntime-web)" } ], "sha256_note": "directories (.mlpackage): sha256 over sorted relative paths + contents"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566ampixa-talkingheadCopyright 2026 Ampixa
This product is a modified derivative of Ditto (antgroup/ditto-talkinghead,https://github.com/antgroup/ditto-talkinghead), licensed under the ApacheLicense, Version 2.0 (see LICENSE).
Changes made: the audio-feature, motion and rendering models were distilledand compressed (smaller student networks, fp16 / int8 weight storage, achannel-pruned real-time renderer trained with a lip-sync loss); the face cropuses MediaPipe only; new runtime (Python API, Core ML and TensorRT backends,child-process compositing). Weights are distributed separately.
Third-party components----------------------
LivePortrait (https://github.com/KwaiVGI/LivePortrait), MIT License.Used for the appearance / motion extractors, warping network, SPADE decoder,stitching network and crop utilities (ampixa_talkinghead/nets/*,ampixa_talkinghead/ops/crop.py) and for the weights they load.
Copyright (c) 2024 Kuaishou Visual Generation and Interaction Center
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
S2G-MDDiffusion (https://github.com/thuhcsi/S2G-MDDiffusion), MIT License.Used for the motion-diffusion network code (ampixa_talkinghead/nets/lmdm/*).
Copyright (c) 2024 Xu He
The MIT permission notice above applies.
rotary-embedding-torch (https://github.com/lucidrains/rotary-embedding-torch), MIT License.Used in the motion-diffusion network (ampixa_talkinghead/nets/lmdm/rotary_embedding_torch.py).
Copyright (c) 2021 Phil Wang
The MIT permission notice above applies.
ConvNeXt-V2 (https://github.com/facebookresearch/ConvNeXt-V2), MIT License for code.The motion-extractor architecture (ampixa_talkinghead/nets/convnextv2.py) is adapted from it via LivePortrait.No ConvNeXt-V2 ImageNet weights (CC-BY-NC 4.0) are distributed; the motion-extractor weights are LivePortrait's.
Copyright (c) Meta Platforms, Inc. and affiliates.
The MIT permission notice above applies.
MediaPipe (https://github.com/google-ai-edge/mediapipe), Apache License 2.0.The face landmarker model (face_landmarker.task, shipped with the weights) andthe mediapipe Python package are used for the face crop and eye state.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586---license: apache-2.0language:- ne- entags:- talking-head- lip-sync- audio-driven- coreml- tensorrt- webgpu- onnxlibrary_name: ampixa-talkingheadpipeline_tag: image-to-video---
# ampixa-talkinghead
One photo + a speech clip → a lip-synced talking-head video. Real time on Apple silicon (M4 Pro, M3 Pro) andNVIDIA GPUs, ~170 MB per platform. Built and evaluated for **Nepali and English**.
<video controls src="https://huggingface.co/ampixa/talkinghead/resolve/main/demo/hero.mp4"></video>
Code: [github.com/Ampixa/talkinghead](https://github.com/Ampixa/talkinghead) · Try it in your browser: [ampixa.com/talkinghead](https://ampixa.com/talkinghead)
```bashpip install "git+https://github.com/Ampixa/talkinghead.git" # Apple silicon / CPUpip install "ampixa-talkinghead[tensorrt] @ git+https://github.com/Ampixa/talkinghead.git" # NVIDIA```
```pythonfrom ampixa_talkinghead import AvatarAvatar("photo.jpg").speak("speech.wav", "out.mp4")```
## Measured
| | ||---|---|| 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) || Download per machine | 169 MB (Apple silicon), 168 MB (NVIDIA) || Peak memory | ~1.7 GB during `speak()` || Lip sync | matches Ditto's quality on our Nepali + English eval (SyncNet LSE-C 5.23 vs 5.31, 15 cases) |
## Files
| 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.
## In the browser
[ampixa.com/talkinghead](https://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 Enginethat 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).
## Demos
Paintings (public domain) with voices from [sanoTTS](https://huggingface.co/ampixa/sanoTTS); people from thepackage's `examples/` speaking Nepali and English ([FLEURS](https://huggingface.co/datasets/google/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.
## Limits
- Works best with a frontal photo, mouth **closed** (visible teeth stop the mouth from closing while speaking).- Weak on stylised paintings with heavy beards / brushwork, very small faces in full-body shots, and profiles.- Do not use it to impersonate real people or to make anyone appear to say things they did not say.
## Licence
Apache-2.0. Derived from [Ditto](https://github.com/antgroup/ditto-talkinghead) (Apache-2.0) and LivePortrait /S2G-MDDiffusion (MIT); see `NOTICE` in the code repository. The face crop uses MediaPipe (Apache-2.0).123version https://git-lfs.github.com/spec/v1oid sha256:b21fb83a6c26dc6236046332f42493c3010d4ba9fa13075b71e81430faf26f77size 1710182123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209{ "kw": { "type": "dict", "keys": [ "max_size", "template_n_frames", "crop_scale", "crop_vx_ratio", "crop_vy_ratio", "crop_flag_do_rot", "smo_k_s", "emo", "eye_f0_mode", "ch_info", "overlap_v2", "fix_kp_cond", "fix_kp_cond_dim", "sampling_timesteps", "online_mode", "v_min_max_for_clip", "smo_k_d", "N_d", "use_d_keys", "relative_d", "drive_eye", "delta_eye_arr", "delta_eye_open_n", "fade_type", "fade_out_keys", "flag_stitching", "overall_ctrl_info" ] }, "kw.max_size": { "type": "value", "value": 1920 }, "kw.template_n_frames": { "type": "value", "value": -1 }, "kw.crop_scale": { "type": "value", "value": 2.3 }, "kw.crop_vx_ratio": { "type": "value", "value": 0 }, "kw.crop_vy_ratio": { "type": "value", "value": -0.125 }, "kw.crop_flag_do_rot": { "type": "value", "value": true }, "kw.smo_k_s": { "type": "value", "value": 13 }, "kw.emo": { "type": "array" }, "kw.eye_f0_mode": { "type": "value", "value": false }, "kw.ch_info": { "type": "dict", "keys": [ "x_s_info_lst", "sc", "eye_open_lst", "eye_ball_lst" ] }, "kw.ch_info.x_s_info_lst": { "type": "list", "len": 1 }, "kw.ch_info.x_s_info_lst.0": { "type": "dict", "keys": [ "pitch", "yaw", "roll", "t", "exp", "scale", "kp" ] }, "kw.ch_info.x_s_info_lst.0.pitch": { "type": "array" }, "kw.ch_info.x_s_info_lst.0.yaw": { "type": "array" }, "kw.ch_info.x_s_info_lst.0.roll": { "type": "array" }, "kw.ch_info.x_s_info_lst.0.t": { "type": "array" }, "kw.ch_info.x_s_info_lst.0.exp": { "type": "array" }, "kw.ch_info.x_s_info_lst.0.scale": { "type": "array" }, "kw.ch_info.x_s_info_lst.0.kp": { "type": "array" }, "kw.ch_info.sc": { "type": "array" }, "kw.ch_info.eye_open_lst": { "type": "list", "len": 1 }, "kw.ch_info.eye_open_lst.0": { "type": "array" }, "kw.ch_info.eye_ball_lst": { "type": "list", "len": 1 }, "kw.ch_info.eye_ball_lst.0": { "type": "array" }, "kw.overlap_v2": { "type": "value", "value": 10 }, "kw.fix_kp_cond": { "type": "value", "value": 1 }, "kw.fix_kp_cond_dim": { "type": "value", "value": [ 0, 202 ] }, "kw.sampling_timesteps": { "type": "value", "value": 50 }, "kw.online_mode": { "type": "value", "value": false }, "kw.v_min_max_for_clip": { "type": "array" }, "kw.smo_k_d": { "type": "value", "value": 3 }, "kw.N_d": { "type": "value", "value": -1 }, "kw.use_d_keys": { "type": "value", "value": null }, "kw.relative_d": { "type": "value", "value": true }, "kw.drive_eye": { "type": "value", "value": null }, "kw.delta_eye_arr": { "type": "array" }, "kw.delta_eye_open_n": { "type": "value", "value": 0 }, "kw.fade_type": { "type": "value", "value": "d0" }, "kw.fade_out_keys": { "type": "value", "value": [ "exp" ] }, "kw.flag_stitching": { "type": "value", "value": true }, "kw.overall_ctrl_info": { "type": "dict", "keys": [ "delta_pitch" ] }, "kw.overall_ctrl_info.delta_pitch": { "type": "value", "value": 2 }}123version https://git-lfs.github.com/spec/v1oid sha256:a3782863b8a9137b609bda20c522c836c1e8a3cdc6d5207a420849cd4e22439fsize 24830123version https://git-lfs.github.com/spec/v1oid sha256:64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ffsize 3758596123version https://git-lfs.github.com/spec/v1oid sha256:36c37fe70fb05ff0d9e67f593369424b3d1d91abb55764950d4be9b7640cf8c3size 36263525123version https://git-lfs.github.com/spec/v1oid sha256:a9b5515bc5e71fa44f4c979ba0ce770ee5306f95e3a3fa1a34395073cccf08c5size 38846535123version https://git-lfs.github.com/spec/v1oid sha256:7fa353a482119139f17c23a2a671ae0a27e5e80760f2ea497e00d13f82755914size 28401722123version https://git-lfs.github.com/spec/v1oid sha256:f15e41dbd13226d1cff13317fb8f80350d246d04019e8784fe309c2cf7d0306csize 2392365123version https://git-lfs.github.com/spec/v1oid sha256:fc72a4486e45556ac94a677407c6f94b2d2742956b42ec3df2e6cf9f24d5812csize 167149123version https://git-lfs.github.com/spec/v1oid sha256:c27f8bc0d1dad3dd7e68c6fdbbc26f5f856fcce28b05fa81a38591a09544fb49size 30952408123456789101112131415161718{ "fileFormatVersion": "1.0.0", "itemInfoEntries": { "0598B97D-D3B5-4348-9F70-1A3B4DCF8CA6": { "author": "com.apple.CoreML", "description": "CoreML Model Specification", "name": "model.mlmodel", "path": "com.apple.CoreML/model.mlmodel" }, "FF6AA737-7D1D-48AF-8F23-E8199AEFC0A6": { "author": "com.apple.CoreML", "description": "CoreML Model Weights", "name": "weights", "path": "com.apple.CoreML/weights" } }, "rootModelIdentifier": "0598B97D-D3B5-4348-9F70-1A3B4DCF8CA6"}123version https://git-lfs.github.com/spec/v1oid sha256:61008f528c09373ba9da7edfab567422d1166dcd64316c2ae58e9c633848a2f0size 922295123version https://git-lfs.github.com/spec/v1oid sha256:e8a2ab92fd1338440ae1ceb5ff86144780f879aa57b367b911eaf00108471c64size 80459123version https://git-lfs.github.com/spec/v1oid sha256:cd4678e1f77087865dea2e99e34cf6018fd4366846087dadf6d710101a8ec692size 25697664123456789101112131415161718{ "fileFormatVersion": "1.0.0", "itemInfoEntries": { "65FE013A-4C8D-47E9-B3B8-079ED115F9C7": { "author": "com.apple.CoreML", "description": "CoreML Model Specification", "name": "model.mlmodel", "path": "com.apple.CoreML/model.mlmodel" }, "F430C46F-2AAF-4969-A61B-5B0109BC0E15": { "author": "com.apple.CoreML", "description": "CoreML Model Weights", "name": "weights", "path": "com.apple.CoreML/weights" } }, "rootModelIdentifier": "65FE013A-4C8D-47E9-B3B8-079ED115F9C7"}123version https://git-lfs.github.com/spec/v1oid sha256:8e02429cdaa516b17d398cabe6b0587e955a691858f94ad024b00b67fa4c9c85size 533409123version https://git-lfs.github.com/spec/v1oid sha256:633e8b913ee8260117d05cb39ba42338e834f642eded0223e2a8c88f916c66ffsize 200760123version https://git-lfs.github.com/spec/v1oid sha256:7b2ca3d68454fd71686919ce28bfb72ae6227259f97204846087cccafb028194size 313076123version https://git-lfs.github.com/spec/v1oid sha256:b25ac94c9fa0774f2845a269a86a8a908356c31a7b6eb13a7cd6dca9b54267c9size 276100123version https://git-lfs.github.com/spec/v1oid sha256:85d34442c443ada53834a4e0be3c86b409fff97a37d2455a286426d36262be4bsize 335208123version https://git-lfs.github.com/spec/v1oid sha256:5d91ae6462596088d74caa289ddf56e6b657a96fdf6e0651f23ef6c2720cff86size 346170123version https://git-lfs.github.com/spec/v1oid sha256:36a1c36289d7bf08de6b2298e6d9ee7ed11fc75c9a68dfc1013a790c475407e7size 512352123version https://git-lfs.github.com/spec/v1oid sha256:6af4c6528342990d074ee8108fa6d37e0cda84d194f11a6025eaf9eb8a3c4e58size 711141123version https://git-lfs.github.com/spec/v1oid sha256:bb834dbcb7f970a8bc4bcdf5196be87ffbaffbf16f63e50389c415f767210638size 3218812123version https://git-lfs.github.com/spec/v1oid sha256:2d5dd8a9a86f8564f2a3d8fb050c1364b2ce852501598944dee85a0d1d633332size 110932691123version https://git-lfs.github.com/spec/v1oid sha256:2a65f22ff51a55e91d7b22b0358e8fa712fefe741fcd6d3966f434ba4a1bf98dsize 25410535123version https://git-lfs.github.com/spec/v1oid sha256:16cc373400a0c3f5e114dee8ab9d08acd14d7ce95bb31ce9b57eefba4d8a9df4size 31206092123version https://git-lfs.github.com/spec/v1oid sha256:edaec6024525e993ff0f02d20dee9350c272f1754437490b3b3d35f20a02b995size 25501498123version https://git-lfs.github.com/spec/v1oid sha256:1da60e74e272d136b49669bc2db0c8c42530118a9287584985db8b5426f02b4esize 56398816123version https://git-lfs.github.com/spec/v1oid sha256:c8e773cfde912cf852f7737c3ccf727a9af4c57da5eee8e8a75add11935f2401size 2759816123version https://git-lfs.github.com/spec/v1oid sha256:f5a6d96bf239bcc866c80055df2450be39233d28f677b8e33a917886fa286541size 31097525123version https://git-lfs.github.com/spec/v1oid sha256:d80ed0c8f61f47567ceddd7a1cb974b55abf5a9d35a789fe1a5aca3043d550d0size 35284216123version https://git-lfs.github.com/spec/v1oid sha256:1879b5c379f0de22596f8efd5f5edc89895baf634f2c369f328f621865b2f2a9size 1055323123version https://git-lfs.github.com/spec/v1oid sha256:faa3d8d777f87c2c378862e26230581951289c8329c01ea8d8b3fcdf95b5ab5csize 39069985123version https://git-lfs.github.com/spec/v1oid sha256:346ad6bf7b8cd83b246db9813674934595c71bb6b895fbb7ee63f72bda5f0d7csize 32951664123version https://git-lfs.github.com/spec/v1oid sha256:6a1bca1fb68dce95ab665b071540b20feb46045d84ebd1a7c4c0c6786cc975d3size 192562123version https://git-lfs.github.com/spec/v1oid sha256:3dd0f1475e1c101b9f4085d65d7fb7e859830e7f7bb3358c0b20f8f9fcf32f31size 25503037.gitattributes+10
LICENSEAdded+201
MANIFEST.jsonAdded+158
NOTICEAdded+66
README.mdAdded+86
common/appearance_extractor.pthAdded+3
common/defaults.jsonAdded+209
common/defaults.npzAdded+3
common/face_landmarker.taskAdded+3
common/hubert_student.ptAdded+3
common/lmdm_student.ptAdded+3
common/motion_extractor.pthAdded+3
common/stitch_network.pthAdded+3
coreml/decoder.mlpackage/Data/com.apple.CoreML/model.mlmodelAdded+3
coreml/decoder.mlpackage/Data/com.apple.CoreML/weights/weight.binAdded+3
coreml/decoder.mlpackage/Manifest.jsonAdded+18
coreml/decoder_ref.npzAdded+3
coreml/warp.mlpackage/Data/com.apple.CoreML/model.mlmodelAdded+3
coreml/warp.mlpackage/Data/com.apple.CoreML/weights/weight.binAdded+3
coreml/warp.mlpackage/Manifest.jsonAdded+18
demo/clips/01_monalisa.mp4Added+3
demo/clips/02_napoleon.mp4Added+3
demo/clips/03_pearl.mp4Added+3
demo/clips/04_face06_nepali_female_2.mp4Added+3
demo/clips/05_face15_english_male_2.mp4Added+3
demo/clips/06_face04_nepali_male_1.mp4Added+3
demo/clips/07_face13_english_male_1.mp4Added+3
demo/clips/08_face05_nepali_female_1.mp4Added+3
demo/hero.mp4Added+3
full/decoder.pthAdded+3
full/warp_student.ptAdded+3
onnx/decoder_b4.onnxAdded+3
onnx/warp_b1.onnxAdded+3
realtime/renderer.ptAdded+3
web/appearance.onnxAdded+3
web/decoder.onnxAdded+3
web/hubert_body.onnxAdded+3
web/hubert_out.onnxAdded+3
web/lmdm.onnxAdded+3
web/motion_extractor.onnxAdded+3
web/stitch.onnxAdded+3
web/warp.onnxAdded+3