Run the container locally using Docker with GPU support.
Prerequisites
- Nvidia GPU drivers installed.
- CUDA version 12.0 or higher.
Configuration Options
- Port Mapping: The default service port is
9871. You can change this by setting the SERVER_PORT environment variable and updating the -p flag in the docker command. - Model Path (
CHECKPOINT_DIR): To avoid long download and TensorRT (TRT) conversion times, map your existing FasterLivePortrait checkpoints directory into the container using a volume (-v). If no models are found in CHECKPOINT_DIR, the system will attempt to download and convert them automatically (requires internet access).
Example Command
Replace the paths and image names as needed for your environment:
docker run -d --gpus=all \
--name faster_liveportrait_api \
-v E:\my_projects\FasterLivePortrait\checkpoints:/root/FasterLivePortrait/checkpoints \
-e CHECKPOINT_DIR=/root/FasterLivePortrait/checkpoints \
-e SERVER_PORT=9871 \
-p 9871:9871 \
--restart=always \
shaoguo/faster_liveportrait_api:v1.0
Verifying Startup
Check the logs (docker logs <container_id>) to ensure the service is running. Successful startup is indicated by:
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9871 (Press CTRL+C to quit)
Logs are stored internally at /root/FasterLivePortrait/logs/log_run.log.
docker run -d --gpus=all \
--name faster_liveportrait_api \
-v E:\my_projects\FasterLivePortrait\checkpoints:/root/FasterLivePortrait/checkpoints \
-e CHECKPOINT_DIR=/root/FasterLivePortrait/checkpoints \
-e SERVER_PORT=9871 \
-p 9871:9871 \
--restart=always \
shaoguo/faster_liveportrait_api:v1.0