{"skill":{"slug":"zenmux-image-gen","displayName":"ZenMux Image Gen (Nano Banana 2)","summary":"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...","description":"---\nname: zenmux-image-gen\ndescription: |\n  Generate images from text prompts using ZenMux API (Vertex AI protocol with Gemini models).\n  Use when: (1) User wants to generate/create images from text descriptions, (2) User asks for\n  AI image generation, (3) User mentions ZenMux or Gemini image models, (4) User wants to\n  create artwork, illustrations, or visual content programmatically, (5) Image-to-image editing.\n  Supports aspect ratio and resolution control. Requires ZENMUX_API_KEY.\n---\n\n# ZenMux Image Generation\n\nGenerate images from text prompts using ZenMux API with Google Gemini models.\n\n## Quick Start\n\n```bash\n# Generate image (requires ZENMUX_API_KEY env var)\npython3 scripts/generate_image.py \"A cute cat\" output.png\n\n# With aspect ratio and resolution\npython3 scripts/generate_image.py \"A cute cat\" output.png --aspect-ratio 16:9 --image-size 2K\n```\n\n## API Key Setup\n\nGet your API key from https://zenmux.ai.\n\n```bash\n# Set environment variable\nexport ZENMUX_API_KEY=\"sk-...\"\n```\n\n**Security Rules:**\n- NEVER use `--api-key` flag (visible in shell history)\n- NEVER commit API keys to git\n\n## Script Options\n\n| Option | Description |\n|--------|-------------|\n| `--model MODEL` | Model name (default: `google/gemini-3.1-flash-image-preview`) |\n| `--input-image PATH` | Input image for image-to-image generation |\n| `--temperature N` | Randomness 0.0-2.0 (default: 1.0) |\n| `--max-tokens N` | Max output tokens |\n| `--aspect-ratio RATIO` | `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `9:16`, `16:9`, `21:9` |\n| `--image-size SIZE` | `1K` (default), `2K`, `4K` |\n\n## Image-to-Image\n\nEdit existing images with text prompts:\n\n```bash\npython3 scripts/generate_image.py \"Make it nighttime\" result.png --input-image photo.jpg\n```\n\n## Available Models\n\n| Model | Alias | Use Case |\n|-------|-------|----------|\n| `google/gemini-3.1-flash-image-preview` | Nano Banana 2 | Fast & quality (default) |\n| `google/gemini-3-pro-image-preview` | Nano Banana Pro | Best quality |\n| `google/gemini-2.5-flash-image` | Nano Banana | Faster generation |\n\n## Prompt Tips\n\n**Writing effective prompts:**\n- Be specific: \"A golden retriever puppy playing on grass\" instead of \"a dog\"\n- Include details: lighting (golden hour, soft light), style (photorealistic, anime, oil painting)\n- For image-to-image: describe the desired change clearly, e.g., \"Change to nighttime with city lights\"\n- Try 10+ words for better results\n\n## Troubleshooting\n\n| Error | Fix |\n|-------|-----|\n| Input image not found | Check file path; verify file exists |\n| Image too large | Max input size is 20 MB; compress before uploading |\n| 401 Unauthorized | Check `ZENMUX_API_KEY` is set correctly |\n| 429 Rate limited | Wait and retry, or upgrade to paid tier |\n| Request timeout | API may be slow; wait and retry |\n| Network error | Check internet connection |\n| No image in response | Try a different prompt or model |\n| Poor image quality | Use more descriptive prompt (10+ words) |\n\n## Script Features\n\n- **Timeout protection**: Requests timeout after 300 seconds (5 minutes)\n- **Auto-create directories**: Output directories are created automatically\n- **Auto-rename on conflict**: If output file exists, automatically appends number (e.g., `image_1.png`, `image_2.png`)\n- **Input validation**: Checks image format, size, and existence\n- **Clear error messages**: Human-readable error explanations\n- **Format support**: JPG, PNG, WebP, GIF input formats\n\n## Batch Generation\n\nGenerate multiple images by running the script multiple times with different outputs:\n\n```bash\n# Generate variations of the same prompt\nfor i in 1 2 3; do\n  python3 scripts/generate_image.py \"A cute cat in different poses\" \"cat_$i.png\"\ndone\n```\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":733,"installsAllTime":28,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1772546923898,"updatedAt":1778994859917},"latestVersion":{"version":"1.0.0","createdAt":1772546923898,"changelog":"- Initial release of zenmux-image-gen skill.\n- Generate images from text prompts using the ZenMux API and Google Gemini models.\n- Supports aspect ratio and resolution controls, as well as image-to-image editing.\n- Provides a command-line script with options for model selection, prompt details, and output customization.\n- Requires ZENMUX_API_KEY for secure API access.\n- Includes clear setup instructions, prompt tips, error troubleshooting, and batch generation examples.","license":null},"metadata":null,"owner":{"handle":"thinkthinking","userId":"s17fvnm0xm90q8sknnr36s75q986amc0","displayName":"thinkthinking","image":"https://avatars.githubusercontent.com/u/61035602?v=4"},"moderation":null}