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

@ -1,15 +1,16 @@
# 基于多种LLMs组合以及ComfyUI参与的定制化用户海报生成的智能融合ai系统
# 基于多种 LLMs 组合以及 ComfyUI 参与的定制化用户海报生成的智能融合 ai 系统
## 概述
AI海报生成系统集成DeepSeek、Kimi、ComfyUI三大AI模型一键生成Vue组件代码和PSD文件。
AI 海报生成系统集成 DeepSeek、Kimi、ComfyUI 三大 AI 模型,一键生成 Vue 组件代码和 PSD 文件。
**核心功能**:
- 🤖 **AI驱动**: DeepSeek分析 + Kimi文案 + ComfyUI图片
- 🎨 **一键生成**: 输入需求 → Vue代码 + PSD文件
- 🤖 **AI 驱动**: DeepSeek 分析 + Kimi 文案 + ComfyUI 图片
- 🎨 **一键生成**: 输入需求 → Vue 代码 + PSD 文件
- 📱 **REST API**: 统一接口,支持前端集成
- 🎭 **预定义模板**: lotus.jpg, nku.png, stamp.jpg, background.png
- 🖼️ **自动合成**: 多图层PSD文件生成
- 🖼️ **自动合成**: 多图层 PSD 文件生成
## 系统架构
@ -22,6 +23,7 @@ AI海报生成系统集成DeepSeek、Kimi、ComfyUI三大AI模型一键生成
## 快速开始
### 环境准备
```bash
# 创建虚拟环境
conda create -n ai_service python=3.11
@ -38,19 +40,22 @@ cp .env.example .env
```
### 启动服务
```bash
cd scripts
python run_pipeline.py # 选择: 2 (API服务器)
```
### 验证服务
```bash
curl http://localhost:8000/health
```
## API使用
## API 使用
### 生成海报
```bash
curl -X POST http://localhost:8000/api/generate-poster \
-H "Content-Type: application/json" \
@ -58,6 +63,7 @@ curl -X POST http://localhost:8000/api/generate-poster \
```
### 下载文件
```bash
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
@ -83,33 +89,35 @@ ai_service/
## 核心模块
| 模块 | 功能 | AI模型 |
|------|------|--------|
| `utils.py` | 用户输入分析 | DeepSeek |
| `flux_con.py` | 图片生成 | ComfyUI |
| `generate_text.py` | 文案生成 | Kimi |
| `generate_layout.py` | Vue代码生成 | DeepSeek |
| `export_psd_from_json.py` | PSD合成 | - |
| 模块 | 功能 | AI 模型 |
| ------------------------- | ------------ | -------- |
| `utils.py` | 用户输入分析 | DeepSeek |
| `flux_con.py` | 图片生成 | ComfyUI |
| `generate_text.py` | 文案生成 | Kimi |
| `generate_layout.py` | Vue 代码生成 | DeepSeek |
| `export_psd_from_json.py` | PSD 合成 | - |
## 使用示例
### JavaScript调用
### JavaScript 调用
```javascript
const response = await fetch('http://localhost:8000/api/generate-poster', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ user_input: "春节海报,红色背景" })
const response = await fetch("http://localhost:8000/api/generate-poster", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ user_input: "春节海报,红色背景" }),
});
const result = await response.json();
console.log('Vue代码:', result.data.vue_code);
console.log("Vue代码:", result.data.vue_code);
```
### Python调用
### Python 调用
```python
import requests
response = requests.post('http://localhost:8000/api/generate-poster',
response = requests.post('http://localhost:8000/api/generate-poster',
json={"user_input": "端午节海报,传统风格"})
result = response.json()
@ -119,6 +127,7 @@ if result["status"] == "success":
```
### 本地测试
```bash
cd scripts
python run_pipeline.py # 选择: 1 (本地测试)
@ -127,7 +136,8 @@ python run_pipeline.py # 选择: 1 (本地测试)
## 部署
### Docker部署
### Docker 部署
```dockerfile
FROM python:3.11
WORKDIR /app
@ -137,12 +147,14 @@ EXPOSE 8000
CMD ["uvicorn", "scripts.run_pipeline:app", "--host", "0.0.0.0", "--port", "8000"]
```
### PM2部署
### PM2 部署
```bash
pm2 start "uvicorn scripts.run_pipeline:app --host 0.0.0.0 --port 8000" --name poster-api
```
### Nginx反向代理
### Nginx 反向代理
```nginx
server {
listen 80;
@ -155,6 +167,7 @@ server {
## 故障排查
### 常见问题
```bash
# 检查API密钥
echo $DEEPSEEK_API_KEY
@ -168,13 +181,6 @@ netstat -tulpn | grep 8000
## 更新日志
### v2.0.0 (2025-07-03)
- ✅ 重构代码结构,移除冗余代码
- ✅ 新增预定义Vue模板系统
- ✅ 优化工具函数模块化
- ✅ 简化API接口设计
### v 0.5.0(2025-07-05)
### v1.0.0 (2025-01-02)
- ✅ 集成DeepSeek + Kimi + ComfyUI
- ✅ 统一API接口设计
- ✅ 支持Vue组件和PSD文件生成
跑通全流程