Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cache
weights
output
save_audio
165 changes: 165 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
.cache/

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
Pipfile.lock

# poetry
poetry.lock

# pdm
.pdm.toml

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
.idea/

# VS Code
.vscode/

# macOS
.DS_Store

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# Logs
*.log

# Temporary files
*.tmp
*.temp

# Project specific
output/
save_audio/
weights/
examples/multi/1-man.WAV
examples/multi/1-woman.WAV
examples/single/1.wav

*.mp4
66 changes: 66 additions & 0 deletions Dockerfile.cu12
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM pytorch/pytorch:2.4.1-cuda12.1-cudnn9-devel

WORKDIR /app

# Set environment variables for non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Tokyo

# System dependencies
RUN apt-get update && apt-get install -y \
git \
libgl1-mesa-glx \
libglib2.0-0 \
build-essential \
libsm6 \
libxext6 \
libxrender-dev \
curl \
ca-certificates \
tzdata \
ffmpeg \
ninja-build \
&& rm -rf /var/lib/apt/lists/*

# Install UV and update PATH
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"

# Create virtual environment
RUN uv venv /opt/venv --python 3.10
ENV PATH="/opt/venv/bin:$PATH"

# Install Python packages (psutil, packaging)
RUN uv pip install psutil packaging

# Copy dependency files first (Docker cache optimization)
COPY requirements.txt .

# Install packages in virtual environment with UV
RUN uv pip install -r requirements.txt

# Install pip in virtual environment (needed for build)
RUN uv pip install pip

# Install PyTorch, torchvision, torchaudio with CUDA 12.1
RUN uv pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu121

# Install xformers
RUN uv pip install -U xformers==0.0.28 --index-url https://download.pytorch.org/whl/cu121

RUN uv pip install soundfile
RUN uv pip install librosa

RUN uv pip install misaki[en] ninja psutil packaging

# Install flash_attn
RUN uv pip install flash-attn==2.7.4.post1 --no-build-isolation

# Copy application code
COPY . .

# Expose port
EXPOSE 7860

# Run application using virtual environment Python
# CMD ["python", "app.py", "--ip", "0.0.0.0"]
46 changes: 46 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ==========================================================
# ๐Ÿณ InfiniteTalk docker-compose sample
# - NVIDIA GPU environment required
# - Services: Gradio WebUI, Inference CLI
# - For details and usage, refer to README.md
# ==========================================================

version: "3.9"

services:

# ๐ŸŒ InfiniteTalk Gradio WebUI service
infinitetalk-webui:
build:
context: .
dockerfile: Dockerfile.cu12
volumes:
- .:/app
- ./.cache/huggingface:/root/.cache/huggingface
- ./weights:/app/weights
- ./output:/app/output
environment:
- DEBIAN_FRONTEND=noninteractive
- TZ=Asia/Tokyo
ports:
- "8418:8418"
mem_limit: 128g
shm_size: 64g
# command: bash -c "python app.py --ip 0.0.0.0 --ckpt_dir weights/Wan2.1-I2V-14B-480P --wav2vec_dir weights/chinese-wav2vec2-base --infinitetalk_dir weights/InfiniteTalk/single/infinitetalk.safetensors --num_persistent_param_in_dit 0 --motion_frame 9"
tty: true
stdin_open: true
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]


# ----------------------------------------------------------
# Usage examples:
# Start WebUI: docker compose up infinitetalk-webui
# Use CLI: docker compose --profile cli up infinitetalk-cli
# Stop: docker compose down
# ----------------------------------------------------------