From c98c011264a58ca0c758eb7fb6e63af455585952 Mon Sep 17 00:00:00 2001 From: Maki Date: Tue, 26 Aug 2025 22:49:08 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20Translate=20comments=20t?= =?UTF-8?q?o=20English=20in=20Docker=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 4 ++ .gitignore | 165 +++++++++++++++++++++++++++++++++++++++++++++ Dockerfile.cu12 | 66 ++++++++++++++++++ docker-compose.yml | 46 +++++++++++++ 4 files changed, 281 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 Dockerfile.cu12 create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..16e3107 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.cache +weights +output +save_audio diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..708e924 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/Dockerfile.cu12 b/Dockerfile.cu12 new file mode 100644 index 0000000..488039d --- /dev/null +++ b/Dockerfile.cu12 @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0ff5892 --- /dev/null +++ b/docker-compose.yml @@ -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 +# ----------------------------------------------------------