This commit is contained in:
2026-08-19 10:37:51 +08:00
parent a30b0ae532
commit f3d3e02341
2 changed files with 1 additions and 202 deletions
+1 -11
View File
@@ -7,11 +7,7 @@ description: Generate images via AI text-to-image API (GPT Image / Grok). Use wh
通过 FastAPI 文生图服务生成图片,供 Agent 通过 HTTP/cURL 直接调用,无需自己实现模型请求逻辑。
服务端使用 OpenAI Python SDK 请求 GPT Image / Grok Image 上游接口,生成的图片保存在服务端 `output/` 目录,并通过 HTTP 返回访问地址。
- 服务端 API 不要求调用方提供上游 API Key;上游鉴权通过项目根目录 `.env` 配置
- `.env` 不应提交到 Git,复制 `.env.example` 为 `.env` 后填写真实 Key
- 使用 Docker Compose 时会自动读取 `.env` 并注入容器
服务端使用 OpenAI Python SDK 请求 GPT Image / Grok Image 上游接口,生成的图片保存在服务端 `output/<profile_name>/` 目录,并通过 HTTP 返回访问地址。
## 可用脚本
@@ -33,12 +29,6 @@ description: Generate images via AI text-to-image API (GPT Image / Grok). Use wh
## 使用方式
先启动 FastAPI 服务:
```bash
uvicorn agent-image-t2i:app --host 0.0.0.0 --port 8765
```
默认服务地址为 `http://localhost:8765`。
健康检查: