Skill flagged — review recommended

ClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.

ZenMux Image Gen (Nano Banana 2)

v1.0.0

Generate images from text prompts using ZenMux API (Vertex AI protocol with Gemini models). Use when: (1) User wants to generate/create images from text desc...

0· 372· 1 versions· 0 current· 0 all-time· Updated 31m ago· MIT-0

Install

openclaw skills install zenmux-image-gen

ZenMux Image Generation

Generate images from text prompts using ZenMux API with Google Gemini models.

Quick Start

# Generate image (requires ZENMUX_API_KEY env var)
python3 scripts/generate_image.py "A cute cat" output.png

# With aspect ratio and resolution
python3 scripts/generate_image.py "A cute cat" output.png --aspect-ratio 16:9 --image-size 2K

API Key Setup

Get your API key from https://zenmux.ai.

# Set environment variable
export ZENMUX_API_KEY="sk-..."

Security Rules:

  • NEVER use --api-key flag (visible in shell history)
  • NEVER commit API keys to git

Script Options

OptionDescription
--model MODELModel name (default: google/gemini-3.1-flash-image-preview)
--input-image PATHInput image for image-to-image generation
--temperature NRandomness 0.0-2.0 (default: 1.0)
--max-tokens NMax output tokens
--aspect-ratio RATIO1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9
--image-size SIZE1K (default), 2K, 4K

Image-to-Image

Edit existing images with text prompts:

python3 scripts/generate_image.py "Make it nighttime" result.png --input-image photo.jpg

Available Models

ModelAliasUse Case
google/gemini-3.1-flash-image-previewNano Banana 2Fast & quality (default)
google/gemini-3-pro-image-previewNano Banana ProBest quality
google/gemini-2.5-flash-imageNano BananaFaster generation

Prompt Tips

Writing effective prompts:

  • Be specific: "A golden retriever puppy playing on grass" instead of "a dog"
  • Include details: lighting (golden hour, soft light), style (photorealistic, anime, oil painting)
  • For image-to-image: describe the desired change clearly, e.g., "Change to nighttime with city lights"
  • Try 10+ words for better results

Troubleshooting

ErrorFix
Input image not foundCheck file path; verify file exists
Image too largeMax input size is 20 MB; compress before uploading
401 UnauthorizedCheck ZENMUX_API_KEY is set correctly
429 Rate limitedWait and retry, or upgrade to paid tier
Request timeoutAPI may be slow; wait and retry
Network errorCheck internet connection
No image in responseTry a different prompt or model
Poor image qualityUse more descriptive prompt (10+ words)

Script Features

  • Timeout protection: Requests timeout after 300 seconds (5 minutes)
  • Auto-create directories: Output directories are created automatically
  • Auto-rename on conflict: If output file exists, automatically appends number (e.g., image_1.png, image_2.png)
  • Input validation: Checks image format, size, and existence
  • Clear error messages: Human-readable error explanations
  • Format support: JPG, PNG, WebP, GIF input formats

Batch Generation

Generate multiple images by running the script multiple times with different outputs:

# Generate variations of the same prompt
for i in 1 2 3; do
  python3 scripts/generate_image.py "A cute cat in different poses" "cat_$i.png"
done

Version tags

latestvk978qfmth4etjwwsv52fapcyhd826bde