介绍
# Antigravity Image Generation
使用内部 Google Antigravity API (Gemini 3 Pro Image) 生成高质量图像。此技能通过使用您的 OAuth 凭据直接访问 `daily-cloudcode-pa.sandbox` 端点,无需浏览器自动化。
## 先决条件
- **Google Antigravity OAuth Profile**:必须存在于您的 OpenClaw auth-profiles.json 中。 - **Node.js**:环境中可用。 - **安全提示**:此技能从您的配置文件中读取本地 OAuth 令牌以通过 Google API 进行身份验证。这是内部工具使用的预期行为。
## 用法
### 直接脚本执行
```bash /home/ubuntu/clawd/skills/antigravity-image-gen/scripts/generate.js \ --prompt "A futuristic city on Mars" \ --output "/tmp/mars.png" \ --aspect-ratio "16:9" ```
### 参数
- `--prompt` (必需):图像的描述。 - `--output` (可选):保存图像的路径(默认:`/tmp/antigravity_<ts>.png`)。 - `--aspect-ratio` (可选):`1:1`(默认)、`16:9`、`9:16`、`4:3`、`3:4`。
## 输出
- 脚本将图像写入指定路径。 - 它向 stdout 打印 `MEDIA: <path>`,这允许 Clawdbot 自动检测并显示图像。
## 故障排除
- **429 Resource Exhausted**:已达到配额限制。请稍后等待或检查您的项目限制。 - **No image data found**:模型可能拒绝了提示(安全原因)或 API 结构已更改。请检查“Model message”输出。 - **Auth Error**:确保您已通过 `google-antigravity` 提供商登录。