修改端口: 后端8006, 前端3002

This commit is contained in:
Kevin Wong
2026-01-14 14:54:34 +08:00
parent 302a43a22f
commit 6470f45aa0
6 changed files with 22 additions and 94 deletions

View File

@@ -163,7 +163,7 @@ npm install
```bash ```bash
cd /home/rongye/ProgramFiles/ViGent/backend cd /home/rongye/ProgramFiles/ViGent/backend
source venv/bin/activate source venv/bin/activate
uvicorn app.main:app --host 0.0.0.0 --port 8000 uvicorn app.main:app --host 0.0.0.0 --port 8006
``` ```
### 启动前端 (新开终端) ### 启动前端 (新开终端)
@@ -177,8 +177,8 @@ npm run dev -- --host 0.0.0.0
## 步骤 10: 验证 ## 步骤 10: 验证
1. 访问 http://服务器IP:3000 查看前端 1. 访问 http://服务器IP:3002 查看前端
2. 访问 http://服务器IP:8000/docs 查看 API 文档 2. 访问 http://服务器IP:8006/docs 查看 API 文档
3. 上传测试视频,生成口播视频 3. 上传测试视频,生成口播视频
--- ---
@@ -198,7 +198,7 @@ Type=simple
User=rongye User=rongye
WorkingDirectory=/home/rongye/ProgramFiles/ViGent/backend WorkingDirectory=/home/rongye/ProgramFiles/ViGent/backend
Environment="PATH=/home/rongye/ProgramFiles/ViGent/backend/venv/bin" Environment="PATH=/home/rongye/ProgramFiles/ViGent/backend/venv/bin"
ExecStart=/home/rongye/ProgramFiles/ViGent/backend/venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000 ExecStart=/home/rongye/ProgramFiles/ViGent/backend/venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8006
Restart=always Restart=always
[Install] [Install]
@@ -248,8 +248,8 @@ python3 -c "import torch; print(torch.cuda.is_available())"
```bash ```bash
# 查看端口占用 # 查看端口占用
sudo lsof -i :8000 sudo lsof -i :8006
sudo lsof -i :3000 sudo lsof -i :3002
``` ```
### 查看日志 ### 查看日志

View File

@@ -1,72 +0,0 @@
# ViGent - 数字人口播视频生成系统
基于 MuseTalk + EdgeTTS 的开源数字人口播视频生成系统
## 功能
- 📹 上传静态人物视频,生成口播视频(唇形同步)
- 🎙️ TTS 配音 / 声音克隆
- 💬 自动生成字幕
- 📱 一键发布到多个社交平台
## 技术栈
| 模块 | 技术 |
|------|------|
| 前端 | Next.js 14 |
| 后端 | FastAPI + Celery |
| 唇形同步 | MuseTalk (GPU1) |
| TTS | EdgeTTS |
| 视频处理 | FFmpeg |
| 自动发布 | Playwright |
## 项目结构
```
/home/rongye/ProgramFiles/ViGent/
├── backend/ # FastAPI 后端
├── frontend/ # Next.js 前端
├── models/ # AI 模型 (MuseTalk)
└── deploy.sh # 一键部署脚本
```
## 服务器部署 (Dell R730)
```bash
# 进入部署目录
cd /home/rongye/ProgramFiles/ViGent
# 一键部署
chmod +x deploy.sh
./deploy.sh
```
## 启动服务
```bash
# 后端 API (端口 8000)
cd /home/rongye/ProgramFiles/ViGent/backend
source venv/bin/activate
uvicorn app.main:app --host 0.0.0.0 --port 8000
# 前端 UI (端口 3000)
cd /home/rongye/ProgramFiles/ViGent/frontend
npm run dev
```
## GPU 配置
| GPU | 用途 |
|-----|------|
| GPU 0 (RTX 3090 24GB) | 其他服务 |
| GPU 1 (RTX 3090 24GB) | MuseTalk 唇形同步 |
## 访问地址
- 视频生成: http://服务器IP:3000
- 发布管理: http://服务器IP:3000/publish
- API 文档: http://服务器IP:8000/docs
## License
MIT

View File

@@ -89,7 +89,7 @@ cd models/MuseTalk
```bash ```bash
# 终端 1: 后端 (端口 8000) # 终端 1: 后端 (端口 8000)
cd backend && source venv/bin/activate cd backend && source venv/bin/activate
uvicorn app.main:app --host 0.0.0.0 --port 8000 uvicorn app.main:app --host 0.0.0.0 --port 8006
# 终端 2: 前端 (端口 3000) # 终端 2: 前端 (端口 3000)
cd frontend cd frontend
@@ -119,9 +119,9 @@ npm run dev
| 服务 | 地址 | | 服务 | 地址 |
|------|------| |------|------|
| 视频生成 | http://服务器IP:3000 | | 视频生成 | http://服务器IP:3002 |
| 发布管理 | http://服务器IP:3000/publish | | 发布管理 | http://服务器IP:3002/publish |
| API 文档 | http://服务器IP:8000/docs | | API 文档 | http://服务器IP:8006/docs |
--- ---

View File

@@ -6,7 +6,7 @@ const nextConfig: NextConfig = {
return [ return [
{ {
source: '/api/:path*', source: '/api/:path*',
destination: 'http://127.0.0.1:8000/api/:path*', destination: 'http://127.0.0.1:8006/api/:path*',
}, },
]; ];
}, },

View File

@@ -3,7 +3,7 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
const API_BASE = "http://127.0.0.1:8000"; const API_BASE = "http://127.0.0.1:8006";
// 类型定义 // 类型定义
interface Material { interface Material {

View File

@@ -3,7 +3,7 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import Link from "next/link"; import Link from "next/link";
const API_BASE = "http://127.0.0.1:8000"; const API_BASE = "http://127.0.0.1:8006";
interface Account { interface Account {
platform: string; platform: string;
@@ -113,7 +113,7 @@ export default function PublishPage() {
const handleLogin = async (platform: string) => { const handleLogin = async (platform: string) => {
alert( alert(
`登录功能需要在服务端执行。\n\n请在终端运行:\ncurl -X POST http://localhost:8000/api/publish/login/${platform}` `登录功能需要在服务端执行。\n\n请在终端运行:\ncurl -X POST http://localhost:8006/api/publish/login/${platform}`
); );
}; };
@@ -178,8 +178,8 @@ export default function PublishPage() {
</div> </div>
<div <div
className={`text-sm ${account.logged_in className={`text-sm ${account.logged_in
? "text-green-400" ? "text-green-400"
: "text-gray-500" : "text-gray-500"
}`} }`}
> >
{account.logged_in ? "✓ 已登录" : "未登录"} {account.logged_in ? "✓ 已登录" : "未登录"}
@@ -189,8 +189,8 @@ export default function PublishPage() {
<button <button
onClick={() => handleLogin(account.platform)} onClick={() => handleLogin(account.platform)}
className={`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${account.logged_in className={`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${account.logged_in
? "bg-gray-600 text-gray-300" ? "bg-gray-600 text-gray-300"
: "bg-purple-600 hover:bg-purple-700 text-white" : "bg-purple-600 hover:bg-purple-700 text-white"
}`} }`}
> >
{account.logged_in ? "重新登录" : "登录"} {account.logged_in ? "重新登录" : "登录"}
@@ -275,8 +275,8 @@ export default function PublishPage() {
key={account.platform} key={account.platform}
onClick={() => togglePlatform(account.platform)} onClick={() => togglePlatform(account.platform)}
className={`p-3 rounded-xl border-2 transition-all ${selectedPlatforms.includes(account.platform) className={`p-3 rounded-xl border-2 transition-all ${selectedPlatforms.includes(account.platform)
? "border-purple-500 bg-purple-500/20" ? "border-purple-500 bg-purple-500/20"
: "border-white/10 bg-white/5 hover:border-white/30" : "border-white/10 bg-white/5 hover:border-white/30"
}`} }`}
> >
<span className="text-2xl block mb-1"> <span className="text-2xl block mb-1">
@@ -299,8 +299,8 @@ export default function PublishPage() {
onClick={handlePublish} onClick={handlePublish}
disabled={isPublishing || selectedPlatforms.length === 0} disabled={isPublishing || selectedPlatforms.length === 0}
className={`w-full py-4 rounded-xl font-bold text-lg transition-all ${isPublishing || selectedPlatforms.length === 0 className={`w-full py-4 rounded-xl font-bold text-lg transition-all ${isPublishing || selectedPlatforms.length === 0
? "bg-gray-600 cursor-not-allowed text-gray-400" ? "bg-gray-600 cursor-not-allowed text-gray-400"
: "bg-gradient-to-r from-green-600 to-teal-600 hover:from-green-700 hover:to-teal-700 text-white" : "bg-gradient-to-r from-green-600 to-teal-600 hover:from-green-700 hover:to-teal-700 text-white"
}`} }`}
> >
{isPublishing ? "发布中..." : "🚀 一键发布"} {isPublishing ? "发布中..." : "🚀 一键发布"}