Antigravity 图像生成:Gemini 3 Pro 原生生成 - Openclaw Skills

作者:互联网

2026-03-20

AI教程

什么是 Antigravity 图像生成?

Antigravity 图像生成技能使 AI 智能体能够通过直接对接内部 Google Antigravity API 来创建高保真视觉内容。通过利用 Gemini 3 Pro 图像模型,该技能为脆弱的基于浏览器的自动化工具提供了一个强大的替代方案。

它专为 Openclaw Skills 生态系统构建,利用本地 OAuth 凭据安全地与 Google 的沙盒端点进行身份验证。与标准的网页抓取方法相比,这确保了更快的响应时间、更高的可靠性以及与程序化工作流更好的集成。

下载入口:https://github.com/openclaw/skills/tree/main/skills/ipedrax/antigravity-image-gen

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install antigravity-image-gen

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 antigravity-image-gen。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Antigravity 图像生成 应用场景

  • 直接根据文本提示词创建高分辨率营销资产和 UI 模型。
  • 为开发人员和技术作家自动化视觉内容创建。
  • 为社交媒体或演示文稿幻灯片生成特定纵横比的图像。
  • 将原生 AI 图像生成集成到复杂的智能体主导的开发工作流中。
Antigravity 图像生成 工作原理
  1. 用户向智能体提供文本提示词和可选参数(如纵横比)。
  2. 该技能执行一个本地化的 Node.js 脚本,从环境配置中检索 OAuth 令牌。
  3. 向 Google Antigravity 沙盒端点发送直接 API 请求。
  4. 收到图像数据后,该技能将文件保存到指定的本地路径。
  5. 脚本向终端输出一个专门的 MEDIA 标签,Openclaw Skills 利用该标签在用户界面中渲染图像。

Antigravity 图像生成 配置指南

开始之前,请确保已安装 Node.js 并配置了 Google 凭据。您的 auth-profiles.json 必须包含有效的 Google Antigravity 配置文件。

使用以下命令安装依赖项并运行测试生成:

./scripts/generate.js --prompt "A futuristic laboratory" --aspect-ratio "16:9"

Antigravity 图像生成 数据架构与分类体系

该技能通过 CLI 参数和本地文件系统输出管理数据。它使用以下结构:

参数 类型 描述
--prompt 字符串 图像生成的描述性文本
--output 路径 目标文件路径(默认为 /tmp)
--aspect-ratio 枚举 支持 1:1, 16:9, 9:16, 4:3, 3:4

它还监控 auth.profiles 以在 Openclaw Skills 环境中进行凭据管理。


name: antigravity-image-gen description: Generate images using the internal Google Antigravity API (Gemini 3 Pro Image). High quality, native generation without browser automation. read_when: - User asks to generate an image - User wants to create visual content metadata: {"clawdbot":{"emoji":"??","requires":{"bins":["node"],"config":["auth.profiles"]},"description":"Generates images via internal Google API using local OAuth credentials."}}

Antigravity Image Generation

Generate high-quality images using the internal Google Antigravity API (Gemini 3 Pro Image). This skill bypasses the need for browser automation by using the daily-cloudcode-pa.sandbox endpoint directly with your OAuth credentials.

Prerequisites

  • Google Antigravity OAuth Profile: Must be present in your OpenClaw auth-profiles.json.
  • Node.js: Available in the environment.
  • Security Note: This skill reads local OAuth tokens from your profile to authenticate with Google's API. This is expected behavior for internal tool use.

Usage

Direct Script Execution

/home/ubuntu/clawd/skills/antigravity-image-gen/scripts/generate.js r
  --prompt "A futuristic city on Mars" r
  --output "/tmp/mars.png" r
  --aspect-ratio "16:9"

Arguments

  • --prompt (Required): The description of the image.
  • --output (Optional): Path to save the image (default: /tmp/antigravity_.png).
  • --aspect-ratio (Optional): 1:1 (default), 16:9, 9:16, 4:3, 3:4.

Output

  • The script writes the image to the specified path.
  • It prints MEDIA: to stdout, which allows Clawdbot to automatically detect and display the image.

Troubleshooting

  • 429 Resource Exhausted: Quota limit reached. Wait or check your project limits.
  • No image data found: The model might have refused the prompt (safety) or the API structure changed. Check the "Model message" output.
  • Auth Error: Ensure you have logged in via google-antigravity provider.