gemini-image
Generate images using Google Gemini and Imagen models via scripts/. Use for AI image generation, text-to-image, creating visuals from prompts, generating multiple images, custom aspect ratios, and high-resolution output up to 4K. Triggers on "generate image", "create image", "imagen", "text to image", "AI art", "nano banana".
What this skill does
# Gemini Image Generation
Generate high-quality images from text prompts using Google's Gemini and Imagen models through executable scripts.
## When to Use This Skill
Use this skill when you need to:
- Create visual content from text descriptions
- Generate multiple image variations
- Create images at specific resolutions (1K, 2K, 4K)
- Produce images for different aspect ratios (social media, banners, etc.)
- Generate photorealistic images or artistic visuals
- Create images with person generation controls
- Batch generate multiple images at once
- Combine with text generation for complete content creation
## Available Scripts
### scripts/generate_image.js
**Purpose**: Generate images using Gemini 3 Pro Image or Imagen 4 models
**When to use**:
- Any image generation task
- Multiple image generation (1-4 per request)
- Custom resolution and aspect ratio needs
- Professional asset creation
- Photorealistic or artistic image generation
**Key parameters**:
| Parameter | Description | Example |
|-----------|-------------|---------|
| `prompt` | Text description (required) | `"A futuristic city at sunset"` |
| `--model`, `-m` | Model to use | `gemini-3.1-flash-image-preview` |
| `--output-dir`, `-o` | Output directory for images | `images/` |
| `--name`, `-n` | Base name for output files | `artwork` |
| `--no-timestamp` | Disable auto timestamp | Flag |
| `--aspect`, `-a` | Aspect ratio | `16:9` |
| `--size`, `-s` | Resolution | `2K` or `4K` |
| `--num` | Number of images (1-4) | `4` |
| `--person` | Person generation policy | `allow_adult` |
**Output**: List of saved PNG file paths
## Workflows
### Workflow 1: Basic Image Generation
```bash
node scripts/generate_image.js "A futuristic city at sunset with flying cars"
```
- Best for: Quick image generation, prototypes
- Model: `gemini-3.1-flash-image-preview` (default, Nano Banana 2)
- Output: `images/generated_image_YYYYMMDD_HHMMSS.png`
### Workflow 2: Social Media (Instagram, Facebook)
```bash
node scripts/generate_image.js "Minimalist coffee shop interior" --aspect 1:1 --size 2K --name coffee-shop
```
- Best for: Instagram posts, profile pictures
- Aspect: 1:1 (square format)
- Resolution: 2K (2048x2048)
- Output: `images/coffee-shop_YYYYMMDD_HHMMSS.png`
### Workflow 3: YouTube Thumbnails (16:9)
```bash
node scripts/generate_image.js "Tech gadget review thumbnail with vibrant colors" --aspect 16:9 --size 2K --name thumbnail
```
- Best for: YouTube, video thumbnails
- Aspect: 16:9 (widescreen)
- Resolution: 2K (2752x1536)
- Output: `images/thumbnail_YYYYMMDD_HHMMSS.png`
### Workflow 4: Multiple Variations
```bash
node scripts/generate_image.js "Abstract geometric patterns in blue and gold" --num 4 --name abstract
```
- Best for: A/B testing, design options
- Generates: 4 distinct variations
- Output: `images/abstract_YYYYMMDD_HHMMSS_0.png`, `images/abstract_YYYYMMDD_HHMMSS_1.png`, etc.
### Workflow 5: Custom Output Directory
```bash
node scripts/generate_image.js "Detailed architectural rendering of modern museum" --aspect 16:9 --size 4K --output-dir ./professional/ --name museum
```
- Best for: Print materials, high-end assets, organized projects
- Model: `gemini-3.1-flash-image-preview` or `gemini-3-pro-image-preview` (for 4K)
- Resolution: 4K (5504x3072 for 16:9)
- Directory created automatically if it doesn't exist
### Workflow 6: Photorealistic Images (Imagen 4)
```bash
node scripts/generate_image.js "Robot holding a red skateboard in urban setting" --model imagen-4.0-generate-001 --aspect 16:9 --size 2K --num 2 --name robot-skate
```
- Best for: Realistic photos, product shots
- Model: `imagen-4.0-generate-001` (photorealistic)
- Notes: English prompts only
- Max 4 images per request
### Workflow 7: Blog Post Featured Image
```bash
node scripts/generate_image.js "Serene mountain lake at sunrise with reflections" --aspect 16:9 --size 2K --output-dir ./blog-images/ --name featured-image
```
- Best for: Blog headers, article images
- Combines well with: gemini-text for blog content generation
### Workflow 8: Content Creation Pipeline (Text + Image)
```bash
# 1. Generate content (gemini-text skill)
node skills/gemini-text/scripts/generate.js "Write a product description for smart home device"
# 2. Generate product image (this skill)
node scripts/generate_image.js "Sleek modern smart home device on white background" --aspect 4:3 --size 2K --name product
# 3. Create social media post
```
- Best for: E-commerce, marketing campaigns
- Combines with: gemini-text, gemini-batch for batch production
### Workflow 9: Disable Timestamp
```bash
node scripts/generate_image.js "Fixed filename image" --name my-image --no-timestamp
```
- Best for: When you want complete control over filename
- Output: `images/my-image.png` (no timestamp)
- Use when: Generating files for specific naming schemes or automated pipelines
## Parameters Reference
### Model Selection
| Model | Nickname | Quality | Max Size | Best For |
|-------|----------|---------|----------|----------|
| `gemini-3.1-flash-image-preview` | Nano Banana 2 | Pro-level | 4K | New default, fast + strong quality |
| `gemini-3-pro-image-preview` | Nano Banana Pro | Highest | 4K | Maximum quality and complex text rendering |
| `gemini-2.5-flash-image` | Nano Banana | Good | 2K | High-volume, low-latency |
| `imagen-4.0-generate-001` | Imagen 4 | Photorealistic | 2K | Realistic photos, product shots |
### Aspect Ratios
| Ratio | Use Case | 1K Size | 2K Size |
|-------|----------|----------|----------|
| 1:1 | Instagram, avatars | 1024x1024 | 2048x2048 |
| 16:9 | YouTube, presentations | 1376x768 | 2752x1536 |
| 9:16 | Instagram Stories, TikTok | 768x1376 | 1536x2752 |
| 4:3 | Traditional displays | 1024x768 | 2048x1536 |
| 3:4 | Portrait orientation | 768x1024 | 1536x2048 |
| 21:9 | Ultrawide | - | 5504x2400 |
Note: 4K resolution is available with `gemini-3.1-flash-image-preview` and `gemini-3-pro-image-preview`
### Resolution Guide
| Size | Use Case | Best Model |
|------|----------|-------------|
| 1K (1024px) | Web thumbnails, previews | Any model |
| 2K (2048px) | Standard web, social media | Any model |
| 4K (4096px) | Print, high-end assets | gemini-3-pro only |
### Person Generation Policy
| Policy | Description | Restrictions |
|---------|-------------|----------------|
| `dont_allow` | No people in images | None |
| `allow_adult` | Adults only | Recommended default |
| `allow_all` | All ages | Restricted in EU, UK, CH, MENA |
## Output Interpretation
### File Naming
- Default format: `{name}_YYYYMMDD_HHMMSS.png` (auto timestamp)
- Single image example: `artwork_20260130_031643.png`
- Multiple images: `{name}_YYYYMMDD_HHMMSS_0.png`, `{name}_YYYYMMDD_HHMMSS_1.png`, etc.
- Without timestamp (`--no-timestamp`): `{name}.png`
- Script prints: "Saved: /path/to/file.png"
### Image Quality
- All images include SynthID watermark for authenticity
- PNG format for lossless quality
- Can be converted to JPEG/WEBP if needed
- 4K images are significantly larger file sizes
### Error Messages
- "Model not available": Check model name spelling
- "Unsupported size": Verify size/model combination
- "Aspect ratio error": Use supported ratios for selected model
## Common Issues
### "google-genai or pillow not installed"
```bash
cd scripts && npm install
```
### "Image generation failed"
- Check prompt length (too verbose can fail)
- Try simpler, more focused prompts
- Verify model availability in your region
- Check API quota limits
### "Unsupported aspect ratio"
- Check if ratio is supported by selected model
- Imagen 4 has fewer ratio options than Gemini
- Use 16:9 or 1:1 for best compatibility
### "4K not supported"
- 4K works best with `gemini-3.1-flash-image-preview` or `gemini-3-pro-image-preview`
- Use `--size 2K` for older models
- Try `--model gemini-3.1-flash-image-preview --size 4K`
### "Imagen prompt language error"
- Imagen models support English prompts only
- Use `gemini-3.1-flash-image-preview` for other languages
- TraRelated in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.