v 0.5.0 更新基座的README.md

This commit is contained in:
Wang Xiuqiang 2025-07-05 04:30:04 +08:00
parent a86b258a88
commit 397b6fb1ef

View File

@ -5,6 +5,7 @@
AI 海报生成系统集成 DeepSeek、Kimi、ComfyUI 三大 AI 模型,一键生成 Vue 组件代码和 PSD 文件。 AI 海报生成系统集成 DeepSeek、Kimi、ComfyUI 三大 AI 模型,一键生成 Vue 组件代码和 PSD 文件。
**核心功能**: **核心功能**:
- 🤖 **AI 驱动**: DeepSeek 分析 + Kimi 文案 + ComfyUI 图片 - 🤖 **AI 驱动**: DeepSeek 分析 + Kimi 文案 + ComfyUI 图片
- 🎨 **一键生成**: 输入需求 → Vue 代码 + PSD 文件 - 🎨 **一键生成**: 输入需求 → Vue 代码 + PSD 文件
- 📱 **REST API**: 统一接口,支持前端集成 - 📱 **REST API**: 统一接口,支持前端集成
@ -22,6 +23,7 @@ AI海报生成系统集成DeepSeek、Kimi、ComfyUI三大AI模型一键生成
## 快速开始 ## 快速开始
### 环境准备 ### 环境准备
```bash ```bash
# 创建虚拟环境 # 创建虚拟环境
conda create -n ai_service python=3.11 conda create -n ai_service python=3.11
@ -38,12 +40,14 @@ cp .env.example .env
``` ```
### 启动服务 ### 启动服务
```bash ```bash
cd scripts cd scripts
python run_pipeline.py # 选择: 2 (API服务器) python run_pipeline.py # 选择: 2 (API服务器)
``` ```
### 验证服务 ### 验证服务
```bash ```bash
curl http://localhost:8000/health curl http://localhost:8000/health
``` ```
@ -51,6 +55,7 @@ curl http://localhost:8000/health
## API 使用 ## API 使用
### 生成海报 ### 生成海报
```bash ```bash
curl -X POST http://localhost:8000/api/generate-poster \ curl -X POST http://localhost:8000/api/generate-poster \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
@ -58,6 +63,7 @@ curl -X POST http://localhost:8000/api/generate-poster \
``` ```
### 下载文件 ### 下载文件
```bash ```bash
curl "http://localhost:8000/api/download/psd?session_id=SESSION_ID" -o poster.psd curl "http://localhost:8000/api/download/psd?session_id=SESSION_ID" -o poster.psd
curl "http://localhost:8000/api/download/vue?session_id=SESSION_ID" -o poster.vue curl "http://localhost:8000/api/download/vue?session_id=SESSION_ID" -o poster.vue
@ -84,7 +90,7 @@ ai_service/
## 核心模块 ## 核心模块
| 模块 | 功能 | AI 模型 | | 模块 | 功能 | AI 模型 |
|------|------|--------| | ------------------------- | ------------ | -------- |
| `utils.py` | 用户输入分析 | DeepSeek | | `utils.py` | 用户输入分析 | DeepSeek |
| `flux_con.py` | 图片生成 | ComfyUI | | `flux_con.py` | 图片生成 | ComfyUI |
| `generate_text.py` | 文案生成 | Kimi | | `generate_text.py` | 文案生成 | Kimi |
@ -94,18 +100,20 @@ ai_service/
## 使用示例 ## 使用示例
### JavaScript 调用 ### JavaScript 调用
```javascript ```javascript
const response = await fetch('http://localhost:8000/api/generate-poster', { const response = await fetch("http://localhost:8000/api/generate-poster", {
method: 'POST', method: "POST",
headers: { 'Content-Type': 'application/json' }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ user_input: "春节海报,红色背景" }) body: JSON.stringify({ user_input: "春节海报,红色背景" }),
}); });
const result = await response.json(); const result = await response.json();
console.log('Vue代码:', result.data.vue_code); console.log("Vue代码:", result.data.vue_code);
``` ```
### Python 调用 ### Python 调用
```python ```python
import requests import requests
@ -119,6 +127,7 @@ if result["status"] == "success":
``` ```
### 本地测试 ### 本地测试
```bash ```bash
cd scripts cd scripts
python run_pipeline.py # 选择: 1 (本地测试) python run_pipeline.py # 选择: 1 (本地测试)
@ -128,6 +137,7 @@ python run_pipeline.py # 选择: 1 (本地测试)
## 部署 ## 部署
### Docker 部署 ### Docker 部署
```dockerfile ```dockerfile
FROM python:3.11 FROM python:3.11
WORKDIR /app WORKDIR /app
@ -138,11 +148,13 @@ CMD ["uvicorn", "scripts.run_pipeline:app", "--host", "0.0.0.0", "--port", "8000
``` ```
### PM2 部署 ### PM2 部署
```bash ```bash
pm2 start "uvicorn scripts.run_pipeline:app --host 0.0.0.0 --port 8000" --name poster-api pm2 start "uvicorn scripts.run_pipeline:app --host 0.0.0.0 --port 8000" --name poster-api
``` ```
### Nginx 反向代理 ### Nginx 反向代理
```nginx ```nginx
server { server {
listen 80; listen 80;
@ -155,6 +167,7 @@ server {
## 故障排查 ## 故障排查
### 常见问题 ### 常见问题
```bash ```bash
# 检查API密钥 # 检查API密钥
echo $DEEPSEEK_API_KEY echo $DEEPSEEK_API_KEY
@ -168,13 +181,6 @@ netstat -tulpn | grep 8000
## 更新日志 ## 更新日志
### v2.0.0 (2025-07-03) ### v 0.5.0(2025-07-05)
- ✅ 重构代码结构,移除冗余代码
- ✅ 新增预定义Vue模板系统
- ✅ 优化工具函数模块化
- ✅ 简化API接口设计
### v1.0.0 (2025-01-02) 跑通全流程
- ✅ 集成DeepSeek + Kimi + ComfyUI
- ✅ 统一API接口设计
- ✅ 支持Vue组件和PSD文件生成