v 0.5.0 更新基座的README.md
This commit is contained in:
parent
a86b258a88
commit
397b6fb1ef
36
README.md
36
README.md
@ -5,6 +5,7 @@
|
||||
AI 海报生成系统集成 DeepSeek、Kimi、ComfyUI 三大 AI 模型,一键生成 Vue 组件代码和 PSD 文件。
|
||||
|
||||
**核心功能**:
|
||||
|
||||
- 🤖 **AI 驱动**: DeepSeek 分析 + Kimi 文案 + ComfyUI 图片
|
||||
- 🎨 **一键生成**: 输入需求 → Vue 代码 + PSD 文件
|
||||
- 📱 **REST API**: 统一接口,支持前端集成
|
||||
@ -22,6 +23,7 @@ AI海报生成系统集成DeepSeek、Kimi、ComfyUI三大AI模型,一键生成
|
||||
## 快速开始
|
||||
|
||||
### 环境准备
|
||||
|
||||
```bash
|
||||
# 创建虚拟环境
|
||||
conda create -n ai_service python=3.11
|
||||
@ -38,12 +40,14 @@ cp .env.example .env
|
||||
```
|
||||
|
||||
### 启动服务
|
||||
|
||||
```bash
|
||||
cd scripts
|
||||
python run_pipeline.py # 选择: 2 (API服务器)
|
||||
```
|
||||
|
||||
### 验证服务
|
||||
|
||||
```bash
|
||||
curl http://localhost:8000/health
|
||||
```
|
||||
@ -51,6 +55,7 @@ curl http://localhost:8000/health
|
||||
## 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
|
||||
@ -84,7 +90,7 @@ ai_service/
|
||||
## 核心模块
|
||||
|
||||
| 模块 | 功能 | AI 模型 |
|
||||
|------|------|--------|
|
||||
| ------------------------- | ------------ | -------- |
|
||||
| `utils.py` | 用户输入分析 | DeepSeek |
|
||||
| `flux_con.py` | 图片生成 | ComfyUI |
|
||||
| `generate_text.py` | 文案生成 | Kimi |
|
||||
@ -94,18 +100,20 @@ ai_service/
|
||||
## 使用示例
|
||||
|
||||
### 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
|
||||
import requests
|
||||
|
||||
@ -119,6 +127,7 @@ if result["status"] == "success":
|
||||
```
|
||||
|
||||
### 本地测试
|
||||
|
||||
```bash
|
||||
cd scripts
|
||||
python run_pipeline.py # 选择: 1 (本地测试)
|
||||
@ -128,6 +137,7 @@ python run_pipeline.py # 选择: 1 (本地测试)
|
||||
## 部署
|
||||
|
||||
### Docker 部署
|
||||
|
||||
```dockerfile
|
||||
FROM python:3.11
|
||||
WORKDIR /app
|
||||
@ -138,11 +148,13 @@ CMD ["uvicorn", "scripts.run_pipeline:app", "--host", "0.0.0.0", "--port", "8000
|
||||
```
|
||||
|
||||
### PM2 部署
|
||||
|
||||
```bash
|
||||
pm2 start "uvicorn scripts.run_pipeline:app --host 0.0.0.0 --port 8000" --name poster-api
|
||||
```
|
||||
|
||||
### 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文件生成
|
||||
跑通全流程
|
||||
|
Loading…
Reference in New Issue
Block a user