# Agnes AI 多模态生成

通过 `https://apihub.agnes-ai.com` 调用 Agnes 文本、图片和视频生成 API。

## 快速开始

### 环境配置

```text
AGNES_API_KEY=sk-xxxx
```

### 命令行

```bash
# 文本生成
python agnes_api.py text --prompt "Write a concise product tagline for an AI assistant."

# 流式文本
python agnes_api.py text --prompt "Write a short product intro." --stream

# 图片生成
python agnes_api.py image --prompt "A luminous floating city above a misty canyon at sunrise, cinematic realism" --size 1024x768

# 图生图
python agnes_api.py image --prompt "Turn the scene into a rainy cyberpunk night while preserving composition" --image https://example.com/input.png --size 1024x768

# 文生视频（异步轮询）
python agnes_api.py video --prompt "A cinematic shot of a cat walking on the beach at sunset" --poll

# 图生视频
python agnes_api.py video --prompt "Animate subtle camera movement and natural lighting" --image https://example.com/image.png --poll

# 多图关键帧视频
python agnes_api.py video --prompt "Create a smooth cinematic transition between the two keyframes" --image https://example.com/a.png --image https://example.com/b.png --mode keyframes --poll

# 轻量冒烟测试
python agnes_api.py smoke-test
```

## 模型选择

- 文本：`agnes-2.0-flash`
- 图片：`agnes-image-2.1-flash`
- 视频：`agnes-video-v2.0`

## 注意事项

- 视频 API 是异步的：先创建任务，再通过 `video_id` 轮询结果
- `num_frames` 必须为 `8n + 1` 且 `≤ 441`，推荐 `81` 或 `121`
- 图片和视频生成时，非英文 prompt 需翻译为流畅英文
- 大成本视频生成前警告用户
