diff --git a/Dockerfile.cpu b/Dockerfile.cpu index 817f935..4b19d9a 100644 --- a/Dockerfile.cpu +++ b/Dockerfile.cpu @@ -1,6 +1,6 @@ FROM python:3.10 -ARG FACEFUSION_VERSION=2.6.1 +ARG FACEFUSION_VERSION=3.0.0 ENV GRADIO_SERVER_NAME=0.0.0.0 WORKDIR /facefusion diff --git a/Dockerfile.cuda b/Dockerfile.cuda index 17dd54b..7a29b5e 100644 --- a/Dockerfile.cuda +++ b/Dockerfile.cuda @@ -1,6 +1,6 @@ -FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 +FROM nvidia/cuda:12.6.1-cudnn-runtime-ubuntu22.04 -ARG FACEFUSION_VERSION=2.6.1 +ARG FACEFUSION_VERSION=3.0.0 ENV GRADIO_SERVER_NAME=0.0.0.0 WORKDIR /facefusion @@ -14,5 +14,4 @@ RUN apt-get install curl -y RUN apt-get install ffmpeg -y RUN git clone https://github.com/facefusion/facefusion.git --branch ${FACEFUSION_VERSION} --single-branch . -RUN python install.py --onnxruntime cuda-11.8 --skip-conda - +RUN python install.py --onnxruntime cuda --skip-conda diff --git a/Dockerfile.rocm b/Dockerfile.rocm index 36bb645..d138c4f 100644 --- a/Dockerfile.rocm +++ b/Dockerfile.rocm @@ -1,6 +1,6 @@ -FROM rocm/dev-ubuntu-22.04:5.6 +FROM rocm/dev-ubuntu-22.04:6.2 -ARG FACEFUSION_VERSION=2.6.1 +ARG FACEFUSION_VERSION=3.0.0 ENV GRADIO_SERVER_NAME=0.0.0.0 WORKDIR /facefusion @@ -14,4 +14,4 @@ RUN apt-get install curl -y RUN apt-get install ffmpeg -y RUN git clone https://github.com/facefusion/facefusion.git --branch ${FACEFUSION_VERSION} --single-branch . -RUN python install.py --onnxruntime rocm-5.6 --skip-conda +RUN python install.py --onnxruntime rocm --skip-conda diff --git a/Dockerfile.tensorrt b/Dockerfile.tensorrt new file mode 100644 index 0000000..4081a4c --- /dev/null +++ b/Dockerfile.tensorrt @@ -0,0 +1,19 @@ +FROM nvidia/cuda:12.6.1-cudnn-runtime-ubuntu22.04 + +ARG FACEFUSION_VERSION=3.0.0 +ENV GRADIO_SERVER_NAME=0.0.0.0 + +WORKDIR /facefusion + +RUN apt-get update +RUN apt-get install python3.10 -y +RUN apt-get install python-is-python3 -y +RUN apt-get install pip -y +RUN apt-get install git -y +RUN apt-get install curl -y +RUN apt-get install ffmpeg -y +RUN pip install tensorrt==10.4.0 --extra-index-url https://pypi.nvidia.com + +RUN git clone https://github.com/facefusion/facefusion.git --branch ${FACEFUSION_VERSION} --single-branch . +RUN python install.py --onnxruntime cuda --skip-conda + diff --git a/README.md b/README.md index 02163fc..b0d7f8e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ FaceFusion Docker ================= -> Next generation face swapper and enhancer. +> Industry leading face manipulation platform. [![Build Status](https://img.shields.io/github/actions/workflow/status/facefusion/facefusion-docker/ci.yml.svg?branch=master)](https://github.com/facefusion/facefusion-docker/actions?query=workflow:ci) ![License](https://img.shields.io/badge/license-MIT-green) @@ -28,7 +28,13 @@ Run the `CUDA` container: docker compose -f docker-compose.cuda.yml up ``` -Run the `ROCM` container: +Run the `TensorRT` container: + +``` +docker compose -f docker-compose.tensorrt.yml up +``` + +Run the `ROCm` container: ``` docker compose -f docker-compose.rocm.yml up @@ -41,21 +47,27 @@ Usage Browse the `CPU` container: ``` -http://localhost:7870 +http://localhost:7865 ``` Browse the `CUDA` container: +``` +http://localhost:7870 +``` + +Browse the `TensorRT` container: + +``` +http://localhost:7875 +``` + +Browse the `ROCm` container: + ``` http://localhost:7880 ``` -Browse the `ROCM` container: - -``` -http://localhost:7890 -``` - Documentation ------------- diff --git a/docker-compose.cpu.yml b/docker-compose.cpu.yml index d8c166b..effdd06 100644 --- a/docker-compose.cpu.yml +++ b/docker-compose.cpu.yml @@ -3,8 +3,9 @@ services: build: context: . dockerfile: Dockerfile.cpu - command: [ 'python', 'run.py' ] + command: [ 'python', 'facefusion.py', 'run' ] volumes: - .assets:/facefusion/.assets + - .caches:/facefusion/.caches ports: - - 7870:7860 + - 7865:7860 diff --git a/docker-compose.cuda.yml b/docker-compose.cuda.yml index d429325..43c99c3 100644 --- a/docker-compose.cuda.yml +++ b/docker-compose.cuda.yml @@ -3,11 +3,12 @@ services: build: context: . dockerfile: Dockerfile.cuda - command: [ 'python', 'run.py', '--execution-providers', 'cuda' ] + command: [ 'python', 'facefusion.py', 'run', '--execution-providers', 'cuda' ] volumes: - .assets:/facefusion/.assets + - .caches:/facefusion/.caches ports: - - 7880:7860 + - 7870:7860 deploy: resources: reservations: diff --git a/docker-compose.rocm.yml b/docker-compose.rocm.yml index 49b6223..a96b0d0 100644 --- a/docker-compose.rocm.yml +++ b/docker-compose.rocm.yml @@ -3,11 +3,12 @@ services: build: context: . dockerfile: Dockerfile.rocm - command: [ 'python', 'run.py', '--execution-providers', 'rocm' ] + command: [ 'python', 'facefusion.py', 'run', '--execution-providers', 'rocm' ] volumes: - .assets:/facefusion/.assets + - .caches:/facefusion/.caches ports: - - 7890:7860 + - 7880:7860 deploy: resources: reservations: diff --git a/docker-compose.tensorrt.yml b/docker-compose.tensorrt.yml new file mode 100644 index 0000000..2781f8e --- /dev/null +++ b/docker-compose.tensorrt.yml @@ -0,0 +1,17 @@ +services: + facefusion-cuda: + build: + context: . + dockerfile: Dockerfile.cuda + command: [ 'python', 'facefusion.py', 'run', '--execution-providers', 'tensorrt' ] + volumes: + - .assets:/facefusion/.assets + - .caches:/facefusion/.caches + ports: + - 7875:7860 + deploy: + resources: + reservations: + devices: + - driver: nvidia + capabilities: [ gpu, video ]