โ† All skills
Tencent SkillHub ยท Developer Tools

xAI Image Generator

Generate images from text prompts using xAI's Grok API with options for format, batch size, and automatic media attachment in OpenClaw.

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

Generate images from text prompts using xAI's Grok API with options for format, batch size, and automatic media attachment in OpenClaw.

โฌ‡ 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
DEPLOYMENT.md, README.md, SKILL.md, SUMMARY.md, requirements.txt, skill.json

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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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.0

Documentation

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

xai-image-gen

Generate images using xAI's Grok API (grok-imagine-image model).

Description

Production-ready CLI tool for generating images via xAI's image generation API. Supports multiple output formats, resolutions, and batch generation. Automatically outputs MEDIA: paths for OpenClaw auto-attachment. Features: ๐ŸŽจ Simple CLI interface: xai-gen "<prompt>" ๐Ÿ–ผ๏ธ Multiple output formats: URL download, base64 encoding ๐Ÿ”ข Batch generation (multiple images per prompt) โšก Fast, pure API implementation (Pi-safe) ๐Ÿ›ก๏ธ Robust error handling with user-friendly messages ๐Ÿ“Ž Auto-attaches generated images in OpenClaw ๐ŸŽฏ Uses xAI's native resolution (no size parameter needed)

Installation

# Navigate to skills directory cd ~/.openclaw/workspace/skills # Clone or copy this skill # (or install via clawhub when published) # Install dependencies pip3 install requests # Ensure the script is executable chmod +x xai-image-gen/xai-gen Set your xAI API key: export XAI_API_KEY="your-api-key-here" Add to your shell profile (~/.bashrc, ~/.zshrc) to persist: echo 'export XAI_API_KEY="your-api-key-here"' >> ~/.bashrc

Basic Usage

# Generate with simple prompt xai-gen "sunset over mountains" # Custom filename xai-gen "cyberpunk city" --filename city.png # Generate multiple images xai-gen "futuristic vehicle" --n 3 # Base64 output (no download) xai-gen "logo design" --format b64 # Verbose mode xai-gen "space station" --verbose

Options

positional arguments: prompt Text description of the image to generate options: -h, --help Show help message --model MODEL Model name (default: grok-imagine-image) --filename FILENAME Output filename (default: out.png) --format {url,png,b64} Response format: url (download), png (alias), b64 (base64) --n N Number of images to generate (default: 1) --verbose, -v Show detailed progress

Examples

Generate a meme: xai-gen "dumbest trade meme: YOLO panic fail" --filename trade_meme.png Batch generation: xai-gen "logo variations for tech startup" --n 5 # Outputs: out_1.png, out_2.png, out_3.png, out_4.png, out_5.png High-quality artwork: xai-gen "photorealistic portrait of a cat astronaut" --filename cat_astronaut.png

Integration with OpenClaw

The tool outputs MEDIA: /path/to/image.png which OpenClaw automatically detects and attaches to messages. Use in agent workflows: # In an agent skill or automation xai-gen "chart showing Q1 sales data" --filename sales_chart.png # โ†’ Image auto-attaches to response

API Details

Endpoint: https://api.x.ai/v1/images/generations Model: grok-imagine-image Authentication: Bearer token via XAI_API_KEY Rate Limits: Subject to xAI API limits (check xAI docs) Timeout: 60s for generation, 30s for download

Error Handling

The tool handles common errors gracefully: โŒ Missing API key โ†’ Clear instructions โŒ Network errors โ†’ Descriptive messages โŒ API timeouts โ†’ Retry suggestions โŒ Invalid parameters โ†’ Usage hints โŒ File write errors โ†’ Permission checks

Requirements

Python: 3.7+ Dependencies: requests API Key: xAI API key (get from https://console.x.ai) Network: Internet connection required

Platform Compatibility

โœ… Linux (tested on Raspberry Pi) โœ… macOS โœ… Windows (via WSL or native Python) โœ… ARM64 / ARMv7 (Pi-safe, pure API calls)

Troubleshooting

"XAI_API_KEY not found" export XAI_API_KEY="xai-..." "requests library not found" pip3 install requests Permission denied chmod +x xai-gen API errors Check API key validity Verify account has credits Check xAI status page

License

MIT License - Free to use and modify

Author

Built for OpenClaw by subagent xAI Image Gen Skill Builder

Version

1.0.0 - Initial release

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
4 Docs1 Config1 Files
  • SKILL.md Primary doc
  • DEPLOYMENT.md Docs
  • README.md Docs
  • SUMMARY.md Docs
  • skill.json Config
  • requirements.txt Files