Docs index: /llms.txt · every page as Markdown: add .md

‹ Platforms

Python

Render Essence 2 and Expression 2 avatars from your own Python code.

Your computer or serverNo GPU neededAPI secretPython 2.11.21

A file in and frames out, or a live stream of audio in and frames out, on your own machine.

Before you start

To run an avatar without code, use the CLI.

Note: On Linux and Windows, Python renders both models on the CPU alone, no GPU. On macOS it renders on Apple silicon. Windows has its own page: Windows. See CPU only (no GPU).

DetailExpression 2Essence 2
Rendersany character from one portraita photoreal person from one portrait
Installpip install "bithuman[expression-2]"included in the same install
FramesRGB numpy arrays, (height, width, 3) uint8the same
You needCheck
Python 3.10–3.14python3 --version
macOS 14+ on Apple silicon, Linux x86_64 or Linux arm64, or Windows 11 x86_64python3 -c "import platform; print(platform.system(), platform.machine())"
An API secretYour API secret
A paid plan (Creator or higher): usage bills per second while the avatar runsPricing
About 1 GB of disk (570 MB package, 118–190 MB per avatar)df -h .

Install

python3 -m venv .venv
source .venv/bin/activate
pip install "bithuman[expression-2]"

Install into a virtual environment: Debian and Ubuntu refuse a system-wide pip install (externally-managed-environment). If venv is missing, run sudo apt install -y python3-venv first. The package installs no command-line tool.

Authenticate

Set BITHUMAN_API_SECRET in the shell that runs Python (bithuman.open reads it), or pass api_secret= to AsyncBithuman.create(). Downloading a sample avatar needs no account.

Run your first avatar

export BITHUMAN_API_SECRET="<your API secret>"
curl -fL -o wise-pup.imx "https://api.bithuman.ai/v1/agent/A23WJF0199/model/download?model=expression-2"
curl -fsSLo speech.wav https://docs.bithuman.ai/samples/speech.wav
import bithuman
bithuman.open("wise-pup.imx").render("speech.wav", out_mp4="out.mp4")
# → out.mp4: wise-pup speaking the sample, 416×720, 15 s

Open out.mp4 to watch it talk. out_mp4= needs no ffmpeg, and render returns the number of frames written. It takes a path to an audio file (WAV, MP3 and the other common formats), or already-decoded 16 kHz mono audio (int16 or float32 arrays, or raw 16-bit bytes). The same call opens Essence 2 and Essence 1 .imx files: for a photoreal person, download the sofia-ramirez Essence 2 sample with curl -fL -o sofia-ramirez.imx "https://api.bithuman.ai/v1/agent/A52DHS2219/model/download?model=essence-2" and render it the same way (1080×1920).

To process the frames yourself, iterate over render without out_mp4=:

import bithuman

with bithuman.open("wise-pup.imx") as avatar:
    frames = [image for image in avatar.render("speech.wav")]
print(len(frames), "frames of", frames[0].shape)
# → 300 frames of (720, 416, 3)

Frames are RGB; OpenCV expects BGR, so write one with cv2.imwrite("frame.png", image[:, :, ::-1]).

Measured with Python SDK 2.11.6
Capture detailsCaptured on an Apple M4 Mac (macOS) · Python SDK 2.11.6 · sofia-ramirez (Essence 2) · 2026-09-23.

Performance

ConfigurationEssence 2Expression 2
Intel Core i7-13700F (x86_64) Linux · Python CPU only (no GPU)
1.9× real timeIntel Core i7-13700F (x86_64), CPU only (no GPU) · bithuman 2.11.13 · measured 2026-09-26
2.3× real timeIntel Core i7-13700F (x86_64), CPU only (no GPU) · bithuman 2.11.13 · measured 2026-09-26
Apple M4 macOS · Python
6.9× real timeApple M4 · bithuman 2.11.12 · measured 2026-09-25
8.4× real timeApple M4 · bithuman 2.11.12 · measured 2026-09-25

Times real time: seconds of avatar video rendered per second. At 1.0× or more, an avatar holds a live conversation. Select a figure for its release and date. All configurations and how we measure.

A finished render logs its own rate on the bithuman logger at INFO.

This section moved: docs.bithuman.ai/platforms/python#run-your-first-avatar

This section moved: docs.bithuman.ai/platforms/python/app#integrate-into-your-app

This section moved: docs.bithuman.ai/build/voice-agent/python#a-voice-agent-on-your-own-livekit-server

This section moved: docs.bithuman.ai/platforms/python/app#complete-example

This section moved: docs.bithuman.ai/platforms/python/app#requirements

This section moved: docs.bithuman.ai/platforms/python/app#run-it

This section moved: docs.bithuman.ai/platforms/python/app#expected-output

This section moved: docs.bithuman.ai/platforms/python/app#make-it-your-own

This section moved: docs.bithuman.ai/platforms/python/app#platform-notes

This section moved: docs.bithuman.ai/platforms/python/reference

This section moved: docs.bithuman.ai/platforms/python/troubleshooting