大活
This commit is contained in:
78
art-agent/README.md
Normal file
78
art-agent/README.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# Art Agent MVP
|
||||
|
||||
AI 美术资源生成助手 — 通过对话生成游戏美术资源。
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 1. 准备 API Key
|
||||
|
||||
你需要两个 API Key:
|
||||
|
||||
- **OpenAI API Key**:https://platform.openai.com/api-keys
|
||||
- **Replicate API Token**:https://replicate.com/account/api-tokens
|
||||
|
||||
### 2. 启动后端
|
||||
|
||||
```bash
|
||||
cd art-agent/backend
|
||||
|
||||
# 创建虚拟环境(推荐)
|
||||
python -m venv venv
|
||||
venv\Scripts\activate # Windows
|
||||
# source venv/bin/activate # macOS/Linux
|
||||
|
||||
# 安装依赖
|
||||
pip install -r requirements.txt
|
||||
|
||||
# 配置环境变量
|
||||
copy .env.example .env
|
||||
# 编辑 .env,填入你的 API Key
|
||||
|
||||
# 启动
|
||||
uvicorn app.main:app --reload --port 8000
|
||||
```
|
||||
|
||||
### 3. 启动前端
|
||||
|
||||
```bash
|
||||
cd art-agent/frontend
|
||||
|
||||
# 安装依赖(需要 Node.js >= 18)
|
||||
npm install
|
||||
|
||||
# 启动
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### 4. 使用
|
||||
|
||||
打开浏览器访问 http://localhost:3000
|
||||
|
||||
- 输入文字描述你想要的美术资源
|
||||
- 可以上传参考图引导风格
|
||||
- 生成的图片可以点击"保存"按钮下载
|
||||
- 持续对话进行迭代修改
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
art-agent/
|
||||
backend/ # Python FastAPI 后端
|
||||
app/
|
||||
main.py # 入口
|
||||
api/chat.py # 对话 API
|
||||
agent/ # Agent Loop 核心
|
||||
services/ # AI 服务封装
|
||||
frontend/ # Next.js 前端
|
||||
src/
|
||||
app/ # 页面
|
||||
components/ # UI 组件
|
||||
lib/ # 工具函数
|
||||
docs/ # 文档
|
||||
```
|
||||
|
||||
## 技术栈
|
||||
|
||||
- 前端:Next.js + TypeScript + Tailwind CSS
|
||||
- 后端:Python FastAPI + SSE
|
||||
- AI:OpenAI GPT-4o-mini(对话)+ Replicate Flux(图像生成)
|
||||
Reference in New Issue
Block a user