Image
生成和处理图像内容的基础功能模块
Core functionality module for generating and processing image content
clawhub install image使用Antigravity图像生成器创建动态失重效果的创意视觉内容
Create dynamic antigravity visual effects using Antigravity Image Generator for creative content
# 安装 Skill(会下载 SKILL.md 到 .claude/skills/) clawhub install antigravity-image-gen # 之后直接对 Claude 说"用 Antigravity Image Generator 帮我…"即可
# 同样的安装命令,兼容所有支持 SKILL.md 的 AI 编程工具 clawhub install antigravity-image-gen
此 Skill 兼容 OpenClaw 标准。 安装后自动生成 SKILL.md 文件,任何支持 OpenClaw 协议的 AI Agent(Claude Code、Cursor、Windsurf 等)均可直接调用。
需要GPU加速支持,使用Clawhub云平台API,每月免费额度1000张
daily-cloudcode-pa.sandbox endpoint directly with your OAuth credentials.
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"
`
Arguments
--prompt (Required): The description of the image.
--output (Optional): Path to save the image (default: /tmp/antigravity_<ts>.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: <path> 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.#!/usr/bin/env python3
# 反重力图像生成完整脚本
import requests
import json
from pathlib import Path
API_KEY = "your_clawhub_api_key"
BASE_URL = "https://api.clawhub.ai/antigravity"
# 创意文案和参数配置
configs = [
{
"prompt": "水中漂浮的城市建筑群",
"style": "cinematic",
"gravity_intensity": 0.6,
"output": "floating_city.png"
},
{
"prompt": "太空中舞动的极光",
"style": "neon",
"gravity_intensity": 0.9,
"output": "space_aurora.png"
},
{
"prompt": "漂浮在云层中的生物",
"style": "illustration",
"gravity_intensity": 0.5,
"output": "cloud_creature.png"
}
]
headers = {"Authorization": f"Bearer {API_KEY}"}
for config in configs:
payload = {
"prompt": config["prompt"],
"style": config["style"],
"gravity_intensity": config["gravity_intensity"],
"size": "1024x1024",
"quality": "high"
}
response = requests.post(
f"{BASE_URL}/generate",
json=payload,
headers=headers
)
if response.status_code == 200:
with open(config["output"], "wb") as f:
f.write(response.content)
print(f"✓ 已生成: {config['output']}")
else:
print(f"✗ 生成失败: {response.text}")
print("\n所有创意图像生成完成!")图像托管:将图像上传到 img402.dev 获取公开链接,用于消息分享、文档嵌入或社交媒体发布。
Upload images to img402.dev and get a public URL. Free tier: 1MB max, 7-day retention, no auth. Use when the agent needs a hosted image URL — for sharing in messages, embedding in documents, posting to social platforms, or any context that requires a public link to an image file.
clawhub install image-hosting