Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📱 NanoAvatar

Changing how often avatar applications can be used and how many users they can serve

📱 Snapdragon 8 Gen 3 · Lite 37 FPS · ⚡ 112 ms model first frame

Download Full APK Download Lite APK Model weights on Hugging Face

🎬 Demos · Try it · 📊 Benchmarks · English · 简体中文

Animate an avatar with your own voice, offline and without an API key.

🎬 Demos

Generalization demo: The examples below were not used to train the model, nor was it specifically fine-tuned for them.

English demo Chinese demo
demo-en.mp4
demo-zh.mp4

Generate high-fidelity talking-avatar videos directly on your phone, without a cloud GPU.

🚀 Try it on your phone

Version 1.0.0 · Full APK · Lite APK

  1. Install an APK and open the app. Models and an avatar are included.
  2. In Experience mode, hold the record button, speak, then release to animate the avatar with your own voice.
  3. For AI conversation, switch to Conversation mode and enter an Alibaba Cloud API key.
  • Full: complete avatar resources, with generation fixed at 25 FPS.
  • Lite: lightweight models with three seconds of avatar footage, looped for the duration of the input audio. Generation is fixed at 12.5 FPS, with a smaller download and lower compute requirements.

Both versions display FPS and first-frame time in real time.

📊 Performance

Model Device Best model FPS Best first frame Memory / VRAM estimate
📱 NanoAvatar Z60 Ultra · Snapdragon 8 Gen 3 35 FPS 127 ms 834 MiB
📱 NanoAvatar Lite Z60 Ultra · Snapdragon 8 Gen 3 37 FPS 112 ms 700 MiB
⚡ Quantized RTX 4090 · Windows CUDA 333 FPS 18 ms 834 MiB
🖥️ Full precision RTX 4090 · Windows CUDA 224 FPS 37 ms 1119 MiB

🌊 Streaming generation: start speaking as audio arrives. With a streaming LLM and streaming TTS, NanoAvatar starts speaking in about 0.3 seconds in our tests, without waiting for the complete audio.

🖥️ Web: run on your NVIDIA GPU

Requirements: Python 3.11, an NVIDIA GPU and CUDA PyTorch.

Get the source:

git clone https://github.com/wpydcr/NanoAvatar.git
cd NanoAvatar

Download NanoAvatar-avatar.zip and place its extracted avatar/ directory at avatars/person/avatar/ inside the repository. Install the dependencies:

python -m pip install --force-reinstall torch==2.10.0 --index-url https://download.pytorch.org/whl/cu128
python -m pip install -r web/requirements.txt
python -m pip install huggingface_hub

Choose a model to download and run:

🖥️ Full precision

HuBERT FP16 and the lip-sync network in FP32.

hf download wpydcr/NanoAvatar --include "full-precision/*" --local-dir models
python web/run.py --models models/full-precision --avatar avatars/person/avatar

⚡ Quantized (Windows / RTX 4090)

HuBERT W8A16 and mixed INT8 lip-sync inference.

hf download wpydcr/NanoAvatar --include "quantized/*" --local-dir models
python web/run.py --models models/quantized --avatar avatars/person/avatar

The Web runtime selects the model from --models. The quantized CUDA DLL is bundled with the Web code.

Open http://127.0.0.1:8765. Startup loads the models and prepares the avatar.

The reinstall option replaces a same-version CPU wheel that may already be installed in your environment.

  • Local WAV: 16 kHz, mono, PCM16, up to 90 seconds. No cloud account is required.
  • Text conversation: enter a DashScope API key in Settings, or set DASHSCOPE_API_KEY for the server process. The example uses Qwen and CosyVoice; edit web/cloud.py to change services.
  • Stop, clear, reconnect: stop the active response, clear the conversation, or start a new connection. Clearing retains the input draft.

🛠️ Models and source builds

This repository contains inference source code. Weights are hosted on Hugging Face; the APK and avatar package are hosted in Releases.

Platform Source Hugging Face weights
Android android/ android-qnn/
Web, full precision web/ full-precision/(come soon)
Web, quantized web/ quantized/
🔧 Build both Android APKs from one codebase

Use JDK 17 or newer, Android SDK Platform 35 and Build Tools 35.0.0. Set JAVA_HOME and ANDROID_HOME. Prepare the corresponding Full and Lite resource directories; each must contain bundled/payload/phone_config.json and bundled/avatar/avatar.json. The released APKs also contain these resources under assets/bundled/.

From android/, build both variants:

sh gradlew :app:assembleFullRelease :app:assembleLiteRelease -PfullBundleAssets=../bundle-assets/full -PliteBundleAssets=../bundle-assets/lite

On Windows, replace sh gradlew with .\gradlew.bat. Full and Lite both use app/src/main/; the flavors select their models, avatar, icon and frame rate. Both report version 1.0.0, and the release filenames remain NanoAvatar.apk and NanoAvatar-Lite.apk.

⭐ Support NanoAvatar

If NanoAvatar is useful to you, give it a star. Share what you build or report a problem in Issues. For performance reports, include your device, OS version and model package.

📄 License

  • MIT: NanoAvatar-authored source code; Chinese HuBERT weights and their converted variants retain the upstream MIT license.
  • CC BY-NC 4.0: NanoAvatar lip-sync weights and their quantized or compiled variants, the default avatar package, and demo videos.
  • Third-party components: retain their original licenses.

See LICENSE for the scope and full terms. These licenses apply to different materials; they are not a choice between MIT and CC BY-NC 4.0 for the same file.

For commercial licensing, contact [email protected].

About

Real-time, high-quality talking avatars on a 2023 Android phone — 37 FPS, 112 ms first frame.

Topics

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages