mirror of
https://github.com/facefusion/facefusion-docker.git
synced 2026-04-22 09:05:59 +02:00
Initial commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
trim_trailing_whitespace = true
|
||||
@@ -0,0 +1,2 @@
|
||||
github: henryruhs
|
||||
custom: https://paypal.me/henryruhs
|
||||
@@ -0,0 +1,18 @@
|
||||
name: ci
|
||||
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: ${{ matrix.config.image-name }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { docker-file: 'Dockerfile.cpu', image-name: 'facefusion-cpu' }
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- run: docker build -f ${{ matrix.config.docker-file }} -t ${{ matrix.config.image-name }} .
|
||||
- run: docker run -d ${{ matrix.config.image-name }}
|
||||
- run: docker ps | grep -q ${{ matrix.config.image-name }}
|
||||
@@ -0,0 +1,3 @@
|
||||
.assets
|
||||
.idea
|
||||
.vscode
|
||||
@@ -0,0 +1,12 @@
|
||||
FROM python:3.10
|
||||
|
||||
ARG FACEFUSION_VERSION=1.1.0
|
||||
|
||||
ENV GRADIO_SERVER_NAME=0.0.0.0
|
||||
WORKDIR /facefusion
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install ffmpeg -y
|
||||
|
||||
RUN git clone https://github.com/facefusion/facefusion.git --branch $FACEFUSION_VERSION --single-branch .
|
||||
RUN pip install -r requirements.txt
|
||||
@@ -0,0 +1,18 @@
|
||||
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
|
||||
|
||||
ARG FACEFUSION_VERSION=1.1.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 ffmpeg -y
|
||||
|
||||
RUN git clone https://github.com/facefusion/facefusion.git --branch $FACEFUSION_VERSION --single-branch .
|
||||
RUN pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118
|
||||
RUN pip uninstall onnxruntime -y
|
||||
RUN pip install onnxruntime-gpu==1.15.1
|
||||
@@ -0,0 +1,33 @@
|
||||
FROM rocm/dev-ubuntu-22.04:5.4.2-complete
|
||||
|
||||
ARG FACEFUSION_VERSION=1.1.0
|
||||
ARG ONNXRUNTIME_VERSION=1.15.0
|
||||
|
||||
ENV GRADIO_SERVER_NAME=0.0.0.0
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install python3-dev -y
|
||||
RUN apt-get install git -y
|
||||
RUN apt-get install ffmpeg -y
|
||||
|
||||
RUN pip install numpy
|
||||
RUN pip install flake8
|
||||
RUN pip install packaging
|
||||
RUN pip install wheel
|
||||
|
||||
RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.27.4/cmake-3.27.4-linux-x86_64.tar.gz | tar xz -C /opt
|
||||
RUN sudo ln -sf /opt/cmake-3.27.4-linux-x86_64/bin/cmake /usr/bin/cmake
|
||||
RUN sudo ln -sf /opt/cmake-3.27.4-linux-x86_64/bin/ctest /usr/bin/ctest
|
||||
|
||||
WORKDIR /onnxruntime
|
||||
|
||||
RUN git clone https://github.com/Microsoft/onnxruntime --branch v$ONNXRUNTIME_VERSION --single-branch .
|
||||
RUN chmod +x /onnxruntime/tools/ci_build/build.py
|
||||
RUN /onnxruntime/tools/ci_build/build.py --allow_running_as_root --build_dir build --config Release --build_wheel --update --build --parallel --skip_tests --cmake_extra_defines ONNXRUNTIME_VERSION=$ONNXRUNTIME_VERSION --use_rocm --rocm_home /opt/rocm
|
||||
|
||||
WORKDIR /facefusion
|
||||
|
||||
RUN git clone https://github.com/facefusion/facefusion.git --branch $FACEFUSION_VERSION --single-branch .
|
||||
RUN pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/rocm5.4.2
|
||||
RUN pip uninstall onnxruntime -y
|
||||
RUN pip install /onnxruntime/build/Release/dist/*.whl
|
||||
@@ -0,0 +1,63 @@
|
||||
FaceFusion Docker
|
||||
=================
|
||||
|
||||
> Next generation face swapper and enhancer.
|
||||
|
||||
[](https://github.com/facefusion/facefusion-docker/actions?query=workflow:ci)
|
||||

|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Clone the repository:
|
||||
|
||||
```
|
||||
git clone https://github.com/facefusion/facefusion-docker.git
|
||||
```
|
||||
|
||||
Run the `CPU` container:
|
||||
|
||||
```
|
||||
docker-compose -f docker-compose.cpu.yml up
|
||||
```
|
||||
|
||||
Run the `CUDA` container:
|
||||
|
||||
```
|
||||
docker-compose -f docker-compose.cuda.yml up
|
||||
```
|
||||
|
||||
Run the `ROCM` container:
|
||||
|
||||
```
|
||||
docker-compose -f docker-compose.rocm.yml up
|
||||
```
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Browse the `CPU` container:
|
||||
|
||||
```
|
||||
http://localhost:7870
|
||||
```
|
||||
|
||||
Browse the `CUDA` container:
|
||||
|
||||
```
|
||||
http://localhost:7880
|
||||
```
|
||||
|
||||
Browse the `ROCM` container:
|
||||
|
||||
```
|
||||
http://localhost:7890
|
||||
```
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
Read the [documentation](https://docs.facefusion.io) for a deep dive.
|
||||
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
facefusion-cpu:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.cpu
|
||||
command: [ 'python', 'run.py' ]
|
||||
volumes:
|
||||
- .assets:/facefusion/.assets
|
||||
ports:
|
||||
- 7870:7860
|
||||
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
facefusion-cuda:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.cuda
|
||||
command: [ 'python', 'run.py', '--execution-providers', 'cuda' ]
|
||||
volumes:
|
||||
- .assets:/facefusion/.assets
|
||||
ports:
|
||||
- 7880:7860
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
capabilities: [ gpu, video ]
|
||||
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
facefusion-rocm:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.rocm
|
||||
command: [ 'python', 'run.py', '--execution-providers', 'rocm' ]
|
||||
volumes:
|
||||
- .assets:/facefusion/.assets
|
||||
ports:
|
||||
- 7890:7860
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: rocm
|
||||
capabilities: [ gpu, video ]
|
||||
Reference in New Issue
Block a user