feat(dia): two-instance Dia2 deployment (dia2-1b + dia2-2b)

The devnen wrapper is single-model and ignores the OpenAI model field, so
offering both Dia2 models to asset-engine as real per-request choices means
one fixed-model instance per model. Rework the dia stack to run two services
from a dia2-capable image:
  * dia2-2b (:8200, best quality), dia2-1b (:8202, streaming) — both GPU 0
  * each pins its model via a mounted /opt/docker/conf/dia2-*/config.yaml
Retire the legacy Dia 1.6B service.

New dia2-image/Dockerfile builds local/dia:v2 = upstream devnen wrapper +
the dia2 package (copied into site-packages; its pyproject build backend
yields an empty UNKNOWN wheel under the base's old setuptools) + the three
missing runtime deps (transformers/sphn/whisper-timestamped); torch 2.12 /
numpy 2.2 in the base already satisfy Dia2. Both instances verified
end-to-end (HTTP 200, Ogg/Opus 24 kHz).
This commit is contained in:
vh
2026-05-31 14:41:11 -07:00
parent 02b26f45a6
commit 3139e81e8a
3 changed files with 115 additions and 85 deletions
+29 -44
View File
@@ -1,56 +1,41 @@
# Dia / Dia2 stack tunables. Copy to `.env` on irv-ml1 before deploying.
# Dia2 stack tunables. Copy to `.env` on irv-ml1 before deploying.
# Two fixed-model instances (dia2-2b, dia2-1b) from the dia2-capable image.
# ── build pin ────────────────────────────────────────────────────────
# SHA of devnen/Dia-TTS-Server. Use the FULL 40-char SHA — docker
# buildx's git source resolver doesn't accept short hashes. `main`
# works but is NOT reproducible; pin a SHA before you rely on this in
# anger (same churn lesson as chatterbox, whose `main` once broke on an
# upstream path restructure). Latest commits:
# https://github.com/devnen/Dia-TTS-Server/commits/main
DIA_SHA=main
# Local image tag — bump when you change build context to force a
# fresh layer build.
DIA_TAG=v1
# ── image ────────────────────────────────────────────────────────────
# Built in two stages (see README + dia2-image/Dockerfile):
# upstream devnen wrapper -> local/dia:v1
# + dia2 package & its missing deps -> local/dia:v2 (this tag)
# Bump when you change the derived build context.
DIA_TAG=v2
# ── network ──────────────────────────────────────────────────────────
# Host port. Container listens on 8003 internally.
# Reserved on irv-ml1: 8188 ComfyUI, 8190 CosyVoice, 8191 Qwen3-TTS,
# 8192 IndexTTS-2, 8193 Kokoro, 8194 VibeVoice, 8195 Fish-S2,
# 8196 Chatterbox, 8197 Voxtral, 8198 Kyutai, 8199 Zonos, 8765 Parakeet.
# 8200 picked here.
DIA_PORT=8200
# Each container listens on 8003 internally. Reserved on irv-ml1:
# 8188 ComfyUI, 8190 CosyVoice, 8191 Qwen3-TTS, 8192 IndexTTS-2,
# 8193 Kokoro, 8194 VibeVoice, 8195 Fish-S2, 8196 Chatterbox,
# 8197 Voxtral, 8198 Kyutai, 8199 Zonos(gradio), 8200 Dia2-2B,
# 8201 csm, 8202 Dia2-1B, 8203 zonos-api, 8765 Parakeet.
DIA2_2B_PORT=8200
DIA2_1B_PORT=8202
# Bind address. 0.0.0.0 exposes on all interfaces (incl. WG tunnel
# Bind address. 0.0.0.0 exposes on all interfaces (incl. the WG tunnel
# interface 10.100.79.3); 127.0.0.1 restricts to local-only.
DIA_BIND=0.0.0.0
# ── runtime / GPU ────────────────────────────────────────────────────
# Devices visible inside the container. "0" pins to the RTX 3090
# (24 GB) — Dia at BF16 (~7 GB) fits comfortably. Use "1" for the
# A6000 if you'd rather keep the 3090 free.
DIA_GPU_DEVICES=0
# Both Dia2 models are small enough to share the RTX 3090 (device 0).
# Set either to "1" to move it to the A6000 if the 3090 gets crowded.
DIA2_2B_GPU=0
DIA2_1B_GPU=0
# Model selection is config.yaml-driven in the wrapper (model.repo_id),
# not a plain env var. Default in-image model is Dia 1.6B. To pin a
# different default, mount a host config.yaml (see commented volume in
# compose.yaml) setting one of:
# nari-labs/Dia-1.6B — original, single/dual-speaker dialogue
# Dia2-1B — streaming, lower latency
# Dia2-2B — highest quality
# Or just switch live from the Web UI at http://<host>:8200/ .
# ── per-instance config (pins model.repo_id) ─────────────────────────
# conf-convention path (lkraven-owned, no sudo). Each file is a full
# config.yaml with model.repo_id set to that instance's Dia2 model.
DIA2_2B_CONFIG=/opt/docker/conf/dia2-2b/config.yaml
DIA2_1B_CONFIG=/opt/docker/conf/dia2-1b/config.yaml
# ── persistent storage on the host ───────────────────────────────────
# Reference audio dir for voice cloning / speaker prompts. Drop short
# reference WAVs here; the wrapper picks them up by filename. Included
# in restic (cloned voices need the original reference to recreate).
# ── persistent storage on the host (shared by both instances) ────────
# Reference audio for cloning / speaker prompts (included in restic).
DIA_REFERENCE_DIR=/worktank/dia/reference_audio
# HuggingFace cache — Dia/Dia2 checkpoints land here on first start.
# Bind-mounted so they survive container recreate. Excluded from restic
# (regenerable from HF).
# HuggingFace cache — Dia2 checkpoints land here on first start. Shared
# cache is fine (keyed per repo). Excluded from restic (regenerable).
DIA_CACHE_DIR=/worktank/dia/cache
# Optional: host config.yaml to pin a default model + generation
# defaults. Leave commented in compose.yaml unless you want it.
# DIA_CONFIG=/worktank/dia/config.yaml