Files
ViGent2/README.md
Kevin Wong 661a8f357c 更新
2026-01-29 12:16:41 +08:00

175 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ViGent2 - 数字人口播视频生成系统
基于 **LatentSync 1.6 + EdgeTTS** 的开源数字人口播视频生成系统。
> 📹 上传静态人物视频 → 🎙️ 输入口播文案 → 🎬 自动生成唇形同步视频
---
## ✨ 功能特性
- 🎬 **唇形同步** - LatentSync 1.6 驱动512×512 高分辨率 Diffusion 模型
- 🎙️ **TTS 配音** - EdgeTTS 多音色支持(云溪、晓晓等)
- 🔊 **声音克隆** - Qwen3-TTS 0.6B3秒参考音频快速克隆 🆕
- 📱 **全自动发布** - 扫码登录 + Cookie持久化支持多平台(B站/抖音/小红书)定时发布
- 🖥️ **Web UI** - Next.js 现代化界面iOS/Android 移动端适配
- 🔐 **用户系统** - Supabase + JWT 认证,支持管理员后台、注册/登录
- 👥 **多用户隔离** - 素材/视频/Cookie 按用户独立存储,数据完全隔离
- 🚀 **性能优化** - 视频预压缩、常驻模型服务 (0s加载)、本地文件直读
## 🛠️ 技术栈
| 模块 | 技术 |
|------|------|
| 前端 | Next.js 14 + TypeScript + TailwindCSS |
| 后端 | FastAPI + Python 3.10 |
| 数据库 | **Supabase** (PostgreSQL) 自托管 Docker |
| 存储 | **Supabase Storage** (本地文件系统) |
| 认证 | **JWT** + HttpOnly Cookie |
| 唇形同步 | **LatentSync 1.6** (Latent Diffusion, 512×512) |
| TTS | EdgeTTS |
| 声音克隆 | **Qwen3-TTS 0.6B** |
| 视频处理 | FFmpeg |
| 自动发布 | Playwright |
---
## 📂 项目结构
```
ViGent2/
├── backend/ # FastAPI 后端
│ ├── app/
│ │ ├── api/ # API 路由
│ │ ├── services/ # 核心服务 (TTS, LipSync, Video)
│ │ └── core/ # 配置
│ ├── requirements.txt
│ └── .env.example
├── frontend/ # Next.js 前端
│ └── src/app/
├── models/ # AI 模型
│ └── LatentSync/ # 唇形同步模型
│ └── DEPLOY.md # LatentSync 部署指南
└── Docs/ # 文档
├── DEPLOY_MANUAL.md # 部署手册
├── AUTH_DEPLOY.md # 认证部署指南
├── task_complete.md
└── DevLogs/
```
---
## 🚀 快速开始
### 1. 克隆项目
```bash
git clone <仓库地址> /home/rongye/ProgramFiles/ViGent2
cd /home/rongye/ProgramFiles/ViGent2
```
### 2. 安装后端
```bash
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
```
### 3. 安装前端
```bash
cd frontend
npm install
```
### 4. 安装 LatentSync (服务器)
详见 [models/LatentSync/DEPLOY.md](models/LatentSync/DEPLOY.md)
```bash
# 创建独立 Conda 环境
conda create -n latentsync python=3.10.13
conda activate latentsync
# 安装依赖并下载权重
cd models/LatentSync
pip install -r requirements.txt
huggingface-cli download ByteDance/LatentSync-1.6 --local-dir checkpoints
```
### 5. 启动服务
```bash
# 终端 1: 后端 (端口 8006)
cd backend && source venv/bin/activate
uvicorn app.main:app --host 0.0.0.0 --port 8006
# 终端 2: 前端 (端口 3002)
cd frontend
npm run dev -- -p 3002
# 终端 3: LatentSync 服务 (端口 8007, 推荐启动)
cd models/LatentSync
nohup python -m scripts.server > server.log 2>&1 &
```
---
## 🖥️ 服务器配置
**目标服务器**: Dell PowerEdge R730
| 配置 | 规格 |
|------|------|
| CPU | 2× Intel Xeon E5-2680 v4 (56 线程) |
| 内存 | 192GB DDR4 |
| GPU | 2× NVIDIA RTX 3090 24GB |
| 存储 | 4.47TB |
**GPU 分配**:
- GPU 0: 其他服务
- GPU 1: **LatentSync** 唇形同步 (~18GB VRAM)
---
## 🌐 访问地址
| 服务 | 地址 | 说明 |
|------|------|------|
| **视频生成 (UI)** | `https://vigent.hbyrkj.top` | 用户访问入口 |
| **API 服务** | `http://<服务器IP>:8006` | 后端 Swagger |
| **认证管理 (Studio)** | `https://supabase.hbyrkj.top` | 需要 Basic Auth |
| **认证 API (Kong)** | `https://api.hbyrkj.top` | Supabase 接口 |
| **唇形同步服务** | `http://<服务器IP>:8007` | LatentSync |
| **声音克隆服务** | `http://<服务器IP>:8009` | Qwen3-TTS |
---
## 📖 文档
- [手动部署指南](Docs/DEPLOY_MANUAL.md)
- [Supabase 部署指南](Docs/SUPABASE_DEPLOY.md)
- [LatentSync 部署指南](models/LatentSync/DEPLOY.md)
- [开发日志](Docs/DevLogs/)
- [任务进度](Docs/task_complete.md)
---
## 🆚 与 ViGent 的区别
| 特性 | ViGent (v1) | ViGent2 |
|------|-------------|---------|
| 唇形同步模型 | MuseTalk v1.5 | **LatentSync 1.6** |
| 分辨率 | 256×256 | **512×512** |
| 架构 | GAN | **Latent Diffusion** |
| 视频预处理 | 无 | **自动压缩优化** |
---
## 📄 License
MIT