--- license: cc-by-nc-4.0 tags: - talking-head - facial-animation - flame - 3d - speech-driven-animation - qwen3-omni - flow-matching --- # TokTalk TokTalk animates a 3D [FLAME](https://flame.is.tue.mpg.de) head directly from the **speech tokens** of [Qwen3-Omni](https://github.com/QwenLM/Qwen3-Omni). It reads the talker's codec frames rather than the synthesized waveform, so the face can be generated in step with the speech while the model is still talking. Driven by Qwen3-Omni on one H100, a realtime voice chat shows the first speech and face chunk about 0.4 s after a message is sent. These are the TokTalk network weights. The inference code is on GitHub: **[Clarivy/TokTalk](https://github.com/Clarivy/TokTalk)**. It provides the `toktalk` Python package, with the realtime browser demo, offline rendering and streaming APIs. ## Files | File | Content | |------|---------| | `epoch=8986.safetensors` | Network weights: flow-matching U-Net decoder and style encoder (85.8 M parameters, fp32) | | `config.yaml` | Network definition (HyperPyYAML) | | `stats_train.npz` | Normalization statistics of the FLAME parameters | `config.yaml` and `stats_train.npz` are also included in the code repository under `toktalk/assets/`. ## Model ``` Qwen3-Omni talker ── codec frames (16 codebooks @ 12.5 Hz) ──► Mimi decoder ──► 512-d features @ 25 Hz └──► TokTalk (conditional flow matching) └──► FLAME parameters @ 25 fps ``` * **Input:** Qwen3-Omni talker codes, turned into 25 Hz features by Kyutai's [Mimi](https://huggingface.co/kyutai/mimi) decoder (RVQ decoder, causal up-sampler and decoder transformer). Every stage is causal, so the features can be computed incrementally. * **Output:** FLAME 2020 parameters at 25 fps: 50 expression coefficients, 3 jaw-pose values and 3 head-rotation values (axis-angle, radians), 56 per frame. * **Network:** a conditional flow-matching 1-D U-Net with transformer blocks, adapted from CosyVoice / Matcha-TTS. Sampling uses 10 Euler steps with classifier-free guidance (scale 1.2). * **Streaming:** the model sees a sliding window of 100 frames (4 s). Motion that was already emitted is kept fixed by in-painting, so chunks join without seams. * **Style:** an optional 80-d style vector, produced by the style encoder from a reference FLAME clip. The zero vector gives the model's own style. The code repository ships styles for eight RAVDESS emotions. * **Speed:** about 0.08 s of compute per 0.4 s of speech on one H100, with the solver replayed from a single CUDA graph. ## Training data HDTF and TFHP talking-face videos, as FLAME parameter sequences at 25 fps (in the [DiffPoseTalk](https://github.com/DiffPoseTalk/DiffPoseTalk) format), paired with Mimi features of the audio. This is the checkpoint at epoch 8986. ## Usage With the [code](https://github.com/Clarivy/TokTalk) installed, put the weights where it expects them: ```bash hf download Clarive/TokTalk epoch=8986.safetensors --local-dir toktalk/assets/model ``` ```python import numpy as np from toktalk import TokTalkConfig, TokTalkPipeline pipe = TokTalkPipeline(TokTalkConfig(device="cuda:0")) codes = np.load("reply.audio_tokens.npy") # (1, 16, T) Qwen3-Omni talker codes params = pipe.codec_tokens_to_flame_params(codes) # (2T, 56) FLAME parameters @ 25 fps pipe.render_mp4(params, audio_path="reply.wav", output_path="face.mp4") ``` Meshes and videos also need the FLAME 2020 model, available after registering at [flame.is.tue.mpg.de](https://flame.is.tue.mpg.de). ## License The weights are released under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/), for non-commercial use only. The FLAME model, which is needed to turn the parameters into meshes, has its own non-commercial license. The training data (HDTF, TFHP) is subject to its own terms.