antigravity-gemini-image

Generate or edit images using the Antigravity-hosted Gemini image model via the local gateway. Use when the user asks to create an image, generate an avatar, or edit/transform an existing image with text instructions. Supports text-to-image and image-to-image editing.

1,061 stars

Best use case

antigravity-gemini-image is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generate or edit images using the Antigravity-hosted Gemini image model via the local gateway. Use when the user asks to create an image, generate an avatar, or edit/transform an existing image with text instructions. Supports text-to-image and image-to-image editing.

Teams using antigravity-gemini-image should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/antigravity-gemini-image/SKILL.md --create-dirs "https://raw.githubusercontent.com/uluckyXH/OpenMOSS/main/skills/antigravity-gemini-image/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/antigravity-gemini-image/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How antigravity-gemini-image Compares

Feature / Agentantigravity-gemini-imageStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generate or edit images using the Antigravity-hosted Gemini image model via the local gateway. Use when the user asks to create an image, generate an avatar, or edit/transform an existing image with text instructions. Supports text-to-image and image-to-image editing.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Antigravity Gemini Image

## Overview
Use the Gemini REST endpoint (via the local gateway base URL) to create or edit images. This skill wraps the correct request format for the **gemini-3.1-flash-image** model, which does **not** work reliably with `/v1/responses` + `image_generation`.

## Quick start

### Text → Image
```bash
mkdir -p ~/.openclaw/workspace/tmp
/usr/bin/python3 {baseDir}/scripts/generate_gemini_image.py \
  --prompt "A cute yellow chick mascot, vector style" \
  --out ~/.openclaw/workspace/tmp/chick.jpg
```

### Image → Image (edit)
```bash
mkdir -p ~/.openclaw/workspace/tmp
/usr/bin/python3 {baseDir}/scripts/generate_gemini_image.py \
  --prompt "Add a tiny red scarf, keep the style" \
  --image /path/to/input.jpg \
  --out ~/.openclaw/workspace/tmp/chick_edit.jpg
```

Optional (explicit .env path):

```bash
/usr/bin/python3 {baseDir}/scripts/generate_gemini_image.py \
  --env-file ~/.openclaw/workspace/.env \
  --prompt "A cute yellow chick mascot, vector style" \
  --out ~/.openclaw/workspace/tmp/chick.jpg
```

macOS Keychain (optional): service `openclaw-local-160`, accounts `base-url` and `api-key`.

## Workflow (always follow)
1) Confirm the prompt (and optional input image) with the user.
2) Run the script in `scripts/generate_gemini_image.py`.
3) Return the generated image file to the user.

## Parameters
- `--prompt` (required): text instruction.
- `--image` (optional): input image for edits.
- `--out` (required): output path (jpg/png).
- `--env-file` (optional): load a specific `.env` file.
- `--base-url` (optional): defaults to `LOCAL_160_BASE_URL`.
- `--api-key` (optional): defaults to `LOCAL_160_API_KEY`.
- `--model` (optional): defaults to `gemini-3.1-flash-image`.
- `--temperature` (optional): default 0.3.
- `--size` (optional): default **4K** (set via `GEMINI_IMAGE_SIZE`).
- `--ratio` (optional): default **16:9** (set via `GEMINI_IMAGE_RATIO`).
- `--timeout` (optional): HTTP 超时(秒),默认 1200(也可用 `GEMINI_IMAGE_TIMEOUT` 或 `LOCAL_160_TIMEOUT`)。

## Notes
- The gateway endpoint is:
  `POST {BASE_URL}/v1beta/models/gemini-3.1-flash-image:generateContent`
- Auth header uses `x-goog-api-key`.
- Image generation can be slow; 10–20 minutes is possible. Keep timeouts high (default 1200s or override via `--timeout` / env).
- Output image is returned as base64 under:
  `candidates[0].content.parts[*].inlineData.data`.
- 4K 输出必须写在 `generationConfig.imageConfig`(**不要**直接写 `image_size`):
  ```json
  {"imageConfig": {"imageSize": "4K", "aspectRatio": "16:9"}}
  ```

## References
- See `references/API.md` for request/response shape.

Related Skills

wordpress-skill

1061
from uluckyXH/OpenMOSS

WordPress 站点管理 Skill — 通过 CLI 工具管理文章、页面、媒体、分类、标签和搜索

task-reviewer-skill

1061
from uluckyXH/OpenMOSS

审查者 Skill — 通过 CLI 工具审查子任务、评分、驳回返工

task-planner-skill

1061
from uluckyXH/OpenMOSS

任务规划师 Skill — 通过 CLI 工具创建任务、拆分模块、分配子任务

task-patrol-skill

1061
from uluckyXH/OpenMOSS

巡查 Skill — 通过 CLI 工具巡查任务状态、标记异常、发送告警

task-executor-skill

1061
from uluckyXH/OpenMOSS

任务执行者 Skill — 通过 CLI 工具领取子任务、提交成果、处理返工

local-web-search

1061
from uluckyXH/OpenMOSS

Use when the user asks for web search that should run via the local-160 Responses API with web_search tool (base URL like https://proxy.example.com, model gpt-5.2-codex(xhigh)). Includes script to query the local endpoint and return summary + citations; use for periodic news monitoring and on-demand searches.

fal-image-edit

31392
from sickn33/antigravity-awesome-skills

AI-powered image editing with style transfer and object removal

alphashop-image

3891
from openclaw/skills

AlphaShop(遨虾)图像处理 API 工具集。支持11个接口:图片翻译、图片翻译PRO、 图片高清放大、图片主题抠图、图片元素识别、图片元素智能消除、图像裁剪、 虚拟试衣(创建+查询)、模特换肤(创建+查询)。 触发场景:图片翻译、翻译图片文字、放大图片、高清放大、抠图、去背景、 检测水印/Logo/文字、消除水印、去牛皮癣、裁剪图片、虚拟试衣、AI试衣、 模特换肤、换模特、AlphaShop图像、遨虾图片处理。

Image Processing & Analysis

image-gen

3891
from openclaw/skills

Generate AI images from text prompts. Triggers on: "生成图片", "画一张", "AI图", "generate image", "配图", "create picture", "draw", "visualize", "generate an image".

Content & Documentation

seo-images

31392
from sickn33/antigravity-awesome-skills

Image optimization analysis for SEO and performance. Checks alt text, file sizes, formats, responsive images, lazy loading, and CLS prevention. Use when user says "image optimization", "alt text", "image SEO", "image size", or "image audit".

seo-image-gen

31392
from sickn33/antigravity-awesome-skills

Generate SEO-focused images such as OG cards, hero images, schema assets, product visuals, and infographics. Use when image generation is part of an SEO workflow or content publishing task.

antigravity-workflows

31392
from sickn33/antigravity-awesome-skills

Orchestrate multiple Antigravity skills through guided workflows for SaaS MVP delivery, security audits, AI agent builds, and browser QA.