โ† All skills
Tencent SkillHub ยท Developer Tools

Grok Imagine Image Pro

Generates and edits high-quality PNG images via xAI Grok/Flux API using prompts, styles, aspect ratios, and batch processing with base64 output.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

Generates and edits high-quality PNG images via xAI Grok/Flux API using prompts, styles, aspect ratios, and batch processing with base64 output.

โฌ‡ 0 downloads โ˜… 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
SKILL.md

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.

Upgrade existing

I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
1.0.2

Documentation

ClawHub primary doc Primary doc: SKILL.md 11 sections Open source page

Grok Imagine Image Pro

API Key: $XAI_API_KEY (already configured) Save dir: ~/.openclaw/media/ (resolves to /data/.openclaw/media/ โ€” allowed for Telegram sending)

Available Models

grok-imagine-image โ€” standard quality, faster grok-imagine-image-pro โ€” higher quality (default for generation)

1. Image Generation

curl -s https://api.x.ai/v1/images/generations \ -H "Authorization: Bearer $XAI_API_KEY" \ -H "Content-Type: application/json" \ --data '{ "model": "grok-imagine-image-pro", "prompt": "<PROMPT>", "n": 1, "response_format": "b64_json" }' | python3 -c " import json, sys, base64, os, time os.makedirs(os.path.expanduser('~/.openclaw/media'), exist_ok=True) r = json.load(sys.stdin) ts = int(time.time()) for i, img in enumerate(r['data']): img_data = base64.b64decode(img['b64_json']) fpath = os.path.expanduser(f'~/.openclaw/media/generated_{ts}_{i}.png') with open(fpath, 'wb') as f: f.write(img_data) print(fpath) "

Aspect Ratios

Add "aspect_ratio": "<ratio>" to the JSON body. Supported values: RatioUse case1:1Social media, thumbnails16:9 / 9:16Widescreen, mobile stories4:3 / 3:4Presentations, portraits3:2 / 2:3Photography2:1 / 1:2Banners, headersautoModel picks best ratio (default)

Batch Generation

Set "n": <count> (1-10) to generate multiple images in one request.

2. Image Editing / Style Transfer

Edit an existing image by providing a source image plus an edit prompt. Uses the same /v1/images/generations endpoint with an added image_url field. Do NOT use /v1/images/edits with multipart โ€” xAI requires JSON. IMPORTANT: For local files, use Python to build the payload JSON file, then curl with @file. Inline base64 in curl args causes "Argument list too long" for images >~100KB. NOTE: This is NOT true image editing โ€” the API generates a new image inspired by the source. It cannot make pixel-precise edits (e.g. changing only a car's color while keeping everything else identical).

Edit from local file (recommended approach):

python3 -c " import json, base64 with open('<SOURCE_PATH>', 'rb') as f: b64 = base64.b64encode(f.read()).decode() payload = { 'model': 'grok-imagine-image', 'prompt': '<EDIT_PROMPT>', 'image_url': f'data:image/png;base64,{b64}', 'n': 1, 'response_format': 'b64_json' } with open('/tmp/img_edit_payload.json', 'w') as f: json.dump(payload, f) print('Payload ready') " && \ curl -s https://api.x.ai/v1/images/generations \ -H "Authorization: Bearer $XAI_API_KEY" \ -H "Content-Type: application/json" \ -d @/tmp/img_edit_payload.json | python3 -c " import json, sys, base64, os, time os.makedirs(os.path.expanduser('~/.openclaw/media'), exist_ok=True) r = json.load(sys.stdin) img_data = base64.b64decode(r['data'][0]['b64_json']) fpath = os.path.expanduser(f'~/.openclaw/media/edited_{int(time.time())}.png') with open(fpath, 'wb') as f: f.write(img_data) print(fpath) "

Edit from URL:

curl -s https://api.x.ai/v1/images/generations \ -H "Authorization: Bearer $XAI_API_KEY" \ -H "Content-Type: application/json" \ --data '{ "model": "grok-imagine-image", "prompt": "<EDIT_PROMPT>", "image_url": "<PUBLIC_IMAGE_URL>", "n": 1, "response_format": "b64_json" }' | python3 -c " import json, sys, base64, os, time os.makedirs(os.path.expanduser('~/.openclaw/media'), exist_ok=True) r = json.load(sys.stdin) img_data = base64.b64decode(r['data'][0]['b64_json']) fpath = os.path.expanduser(f'~/.openclaw/media/edited_{int(time.time())}.png') with open(fpath, 'wb') as f: f.write(img_data) print(fpath) "

Style Transfer Examples

Use editing with a style prompt, e.g.: "Render this as an oil painting in impressionist style" "Make this a pencil sketch with detailed shading" "Convert to pop art with bold colors" "Watercolor painting with soft edges"

3. Sending to Telegram

message tool: action=send, channel=telegram, target=<id>, message="<caption>", filePath=~/.openclaw/media/<file>.png Always include message field (required even for media-only sends) Allowed media paths: /tmp/, ~/.openclaw/media/, ~/.openclaw/agents/

Notes

Do NOT pass size parameter โ€” returns 400 Aspect ratio: pass aspect_ratio in JSON body (not size) Editing: use image_url field in the generations endpoint (NOT the edits endpoint with multipart) Always use "response_format": "b64_json" โ€” URL format returns temporary URLs that often 403 For large images: build payload with Python โ†’ save to /tmp/ โ†’ curl with @file syntax Max 10 images per request Images are subject to content moderation Editing is style-transfer/reimagination, NOT pixel-precise inpainting

Category context

Code helpers, APIs, CLIs, browser automation, testing, and developer operations.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
1 Docs
  • SKILL.md Primary doc