Files
EPEEAIKit/art-agent/README.md
2026-04-12 01:02:14 +08:00

79 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
- AIOpenAI GPT-4o-mini对话+ Replicate Flux图像生成