Files
portainer-core/stacks/stable-audio.yml
T
jpmschweitzerandClaude Opus 4.6 bc1574b36e feat(stack): add Stable Audio and TRELLIS GPU service stacks
- Stable Audio Open: AI audio generation on port 11500 (~6GB VRAM)
- TRELLIS: 3D model generation on port 11510 (~6-8GB VRAM, low-VRAM fork)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:34:34 +01:00

91 lines
3.1 KiB
YAML

version: '3.8'
# Stable Audio Open - AI Audio Generation
# Phase: ML Infrastructure
# Ports: 8000 (Gradio Web UI)
# GPU: YES - Requires NVIDIA Container Toolkit (8GB+ VRAM)
# Storage: SSD recommended for model cache
# Image: Built locally from https://github.com/SaladTechnologies/stable-audio-open
services:
stable-audio:
image: stable-audio-open:local
container_name: stable-audio
restart: unless-stopped
ports:
- "11500:8000" # Gradio Web UI (internal only)
volumes:
# HuggingFace cache for model weights (~6GB)
- /home/jpmschweitzer/docker-data/stable-audio/hf-cache:/root/.cache/huggingface
environment:
- TZ=Europe/Amsterdam
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- HF_TOKEN=${HF_TOKEN}
healthcheck:
test: ["CMD-SHELL", "curl -fSs http://localhost:8000/ || exit 1"]
interval: 60s
timeout: 30s
retries: 3
start_period: 300s # Model download + load takes time
deploy:
resources:
limits:
memory: 16G
reservations:
memory: 8G
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
networks:
- docker-dataplane
networks:
docker-dataplane:
external: true
name: docker-dataplane
# GPU Requirements:
# - RTX 2080 Ti (11GB VRAM) - minimum viable, may struggle with long generations
# - Recommended: 16GB+ VRAM for reliable 47s audio generation
# - NVIDIA Container Toolkit must be installed
#
# IMPORTANT: GPU Contention
# - This service shares GPU with Ollama and Jellyfin
# - Consider stopping Ollama when generating audio for better VRAM availability
# - Monitor with: watch -n 1 nvidia-smi
#
# Prerequisites:
# 1. Build image: cd /home/jpmschweitzer/docker-data/stable-audio-open && docker build -t stable-audio-open:local .
# 2. Create HuggingFace token: https://huggingface.co/settings/tokens (read access)
# 3. Accept model license: https://huggingface.co/stabilityai/stable-audio-open-1.0
# 4. Create data directories:
# mkdir -p /home/jpmschweitzer/docker-data/stable-audio/{hf-cache,output}
#
# After Deployment:
# 1. Set HF_TOKEN in Portainer environment variables
# 2. Deploy stack via Portainer
# 3. First run downloads model weights (~6GB) - be patient
# 4. Verify GPU access: docker exec stable-audio nvidia-smi
# 5. Access Web UI: http://tower-of-joy:11500 or http://audio.schweitz.internal (via NPM)
#
# NPM Configuration (audio.schweitz.internal):
# - Domain: audio.schweitz.internal
# - Scheme: http
# - Forward Hostname: stable-audio (or tower-of-joy)
# - Forward Port: 11500
# - Block Common Exploits: Yes
# - Websockets Support: Yes (required for Gradio)
#
# API Usage (Gradio API):
# curl -X POST http://audio.schweitz.internal/api/predict \
# -H "Content-Type: application/json" \
# -d '{"data": ["epic orchestral music, cinematic", 30, 100, 7]}'
# Parameters: [prompt, duration_seconds, diffusion_steps, cfg_scale]
#
# Rebuilding Image:
# cd /home/jpmschweitzer/docker-data/stable-audio-open
# git pull
# docker build -t stable-audio-open:local .