Add ComfyUI + AudioCraft Docker setup fuer Game Audio
- Dockerfile (NVIDIA RTX 3070, CUDA 12.4, PyTorch 2.3+) - Dockerfile.amd (AMD Radeon 9070, ROCm 6.2) - docker-compose.yml (NVIDIA) / docker-compose.amd.yml (AMD) - ComfyUI-Manager fuer einfache Node-Installation - AudioCraft (MusicGen, AudioGen) fuer Game Audio Generierung Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
59fb813ce6
commit
cc3b2ed942
5 changed files with 155 additions and 0 deletions
44
comfyui-audio/Dockerfile
Normal file
44
comfyui-audio/Dockerfile
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
# System dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
python3.10 \
|
||||||
|
python3-pip \
|
||||||
|
python3.10-venv \
|
||||||
|
git \
|
||||||
|
wget \
|
||||||
|
ffmpeg \
|
||||||
|
libsndfile1 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN ln -s /usr/bin/python3.10 /usr/bin/python
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV GIT_TERMINAL_PROMPT=0
|
||||||
|
|
||||||
|
# Clone ComfyUI
|
||||||
|
RUN git clone https://github.com/comfyanonymous/ComfyUI.git
|
||||||
|
|
||||||
|
WORKDIR /app/ComfyUI
|
||||||
|
|
||||||
|
# Install ComfyUI dependencies
|
||||||
|
RUN pip install --no-cache-dir "torch>=2.3.0" torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Install ComfyUI-Manager (für einfache Node-Installation über die UI)
|
||||||
|
RUN git clone https://github.com/ltdrdata/ComfyUI-Manager.git custom_nodes/ComfyUI-Manager
|
||||||
|
RUN pip install --no-cache-dir -r custom_nodes/ComfyUI-Manager/requirements.txt
|
||||||
|
|
||||||
|
# Build tools für PyAV (audiocraft dependency)
|
||||||
|
RUN apt-get update && apt-get install -y pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# AudioCraft (MusicGen, AudioGen von Meta)
|
||||||
|
RUN pip install --no-cache-dir audiocraft
|
||||||
|
|
||||||
|
EXPOSE 8188
|
||||||
|
|
||||||
|
CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "8188"]
|
||||||
35
comfyui-audio/Dockerfile.amd
Normal file
35
comfyui-audio/Dockerfile.amd
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
FROM rocm/pytorch:rocm6.2_ubuntu22.04_py3.10_pytorch_release_2.3.0
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
ENV GIT_TERMINAL_PROMPT=0
|
||||||
|
ENV HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||||
|
|
||||||
|
# System dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git wget ffmpeg \
|
||||||
|
libsndfile1 \
|
||||||
|
pkg-config libavformat-dev libavcodec-dev libavdevice-dev \
|
||||||
|
libavutil-dev libswscale-dev libswresample-dev libavfilter-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Clone ComfyUI
|
||||||
|
RUN git clone https://github.com/comfyanonymous/ComfyUI.git
|
||||||
|
|
||||||
|
WORKDIR /app/ComfyUI
|
||||||
|
|
||||||
|
# ComfyUI dependencies (torch already included in base image)
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# ComfyUI-Manager
|
||||||
|
RUN git clone https://github.com/ltdrdata/ComfyUI-Manager.git custom_nodes/ComfyUI-Manager
|
||||||
|
RUN pip install --no-cache-dir -r custom_nodes/ComfyUI-Manager/requirements.txt
|
||||||
|
|
||||||
|
# AudioCraft
|
||||||
|
RUN pip install --no-cache-dir audiocraft
|
||||||
|
|
||||||
|
EXPOSE 8188
|
||||||
|
|
||||||
|
CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "8188"]
|
||||||
21
comfyui-audio/docker-compose.amd.yml
Normal file
21
comfyui-audio/docker-compose.amd.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
services:
|
||||||
|
comfyui:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.amd
|
||||||
|
container_name: comfyui-audio
|
||||||
|
ports:
|
||||||
|
- "8188:8188"
|
||||||
|
volumes:
|
||||||
|
- ./models:/app/ComfyUI/models
|
||||||
|
- ./output:/app/ComfyUI/output
|
||||||
|
- ./input:/app/ComfyUI/input
|
||||||
|
- ./custom_nodes:/app/ComfyUI/custom_nodes
|
||||||
|
devices:
|
||||||
|
- /dev/kfd
|
||||||
|
- /dev/dri
|
||||||
|
group_add:
|
||||||
|
- video
|
||||||
|
environment:
|
||||||
|
- HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||||
|
restart: unless-stopped
|
||||||
21
comfyui-audio/docker-compose.yml
Normal file
21
comfyui-audio/docker-compose.yml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
services:
|
||||||
|
comfyui:
|
||||||
|
build: .
|
||||||
|
container_name: comfyui-audio
|
||||||
|
ports:
|
||||||
|
- "8188:8188"
|
||||||
|
volumes:
|
||||||
|
- ./models:/app/ComfyUI/models
|
||||||
|
- ./output:/app/ComfyUI/output
|
||||||
|
- ./input:/app/ComfyUI/input
|
||||||
|
- ./custom_nodes:/app/ComfyUI/custom_nodes
|
||||||
|
environment:
|
||||||
|
- NVIDIA_VISIBLE_DEVICES=all
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- driver: nvidia
|
||||||
|
count: all
|
||||||
|
capabilities: [gpu]
|
||||||
|
restart: unless-stopped
|
||||||
34
comfyui-audio/setup.md
Normal file
34
comfyui-audio/setup.md
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# ComfyUI + AudioCraft Setup
|
||||||
|
|
||||||
|
## Voraussetzungen
|
||||||
|
- Docker Desktop mit WSL2 Backend
|
||||||
|
- NVIDIA Container Toolkit (in Docker Desktop integriert ab Version 4.x)
|
||||||
|
|
||||||
|
## Einmalig: WSL2 NVIDIA Support aktivieren
|
||||||
|
In Docker Desktop → Settings → Resources → GPU → Enable GPU support aktivieren.
|
||||||
|
|
||||||
|
## Starten
|
||||||
|
```bash
|
||||||
|
cd comfyui-audio
|
||||||
|
docker compose up --build
|
||||||
|
```
|
||||||
|
Beim ersten Start lädt es alle Abhängigkeiten (~5-10 min).
|
||||||
|
|
||||||
|
## ComfyUI öffnen
|
||||||
|
http://localhost:8188
|
||||||
|
|
||||||
|
## AudioCraft Modelle laden
|
||||||
|
Die Modelle werden automatisch beim ersten Nutzen heruntergeladen und unter `./models` gecacht.
|
||||||
|
|
||||||
|
Empfohlene Modelle für Game Audio:
|
||||||
|
- `musicgen-medium` — Musik/Atmosphäre (1.5GB)
|
||||||
|
- `musicgen-stereo-medium` — Stereo Musik
|
||||||
|
- `audiogen-medium` — Sound Effects (Schritte, Umgebungsgeräusche)
|
||||||
|
|
||||||
|
## Workflow für das Game
|
||||||
|
1. Atmosphärische Musik: musicgen mit Prompt wie *"dark dungeon ambience, slow, mysterious"*
|
||||||
|
2. Kampfmusik: *"epic battle music, drums, dark fantasy"*
|
||||||
|
3. Sound Effects via audiogen: *"sword clash metal", "footsteps stone floor"*
|
||||||
|
|
||||||
|
## Output
|
||||||
|
Generierte Audiodateien landen unter `./output/`
|
||||||
Loading…
Add table
Reference in a new issue