image-gen
Generate images using Google's Nano Banana 2 (Gemini 3.1 Flash Image) with workflow-based prompting
What this skill does
# Image Generation Skill Generate professional images, infographics, and diagrams using Google's Nano Banana 2 model (gemini-3.1-flash-image-preview). ## Model Capabilities **Nano Banana 2** (released February 26, 2026): - **Text rendering** - Accurate, legible text in images - **Google Search grounding** - Real-time data (weather, stocks, etc.) - **Subject consistency** - Up to 5 characters maintained across generations - **Multi-turn conversation** - Iterative refinement - **Up to 14 reference images** - For composition and style transfer - **Resolutions**: 1K, 2K, 4K - **Aspect ratios**: 1:1, 2:3, 3:2, 4:3, 16:9, 21:9 ## Scripts All scripts use Python via `uv run` with inline dependencies. ### generate.py - Text to Image ```bash uv run scripts/generate.py "prompt" output.png [aspect_ratio] [size] ``` **Examples:** ```bash # Basic image uv run scripts/generate.py "A cozy coffee shop in autumn" coffee.png # Infographic with specific aspect ratio uv run scripts/generate.py "Infographic explaining how neural networks work" nn.png 16:9 2K # 4K professional image uv run scripts/generate.py "Professional headshot, studio lighting" headshot.png 3:2 4K ``` ### edit.py - Image Editing ```bash uv run scripts/edit.py input.png "edit instructions" output.png ``` **Examples:** ```bash # Edit existing image uv run scripts/edit.py photo.png "Change the background to a beach sunset" edited.png ``` ### compose.py - Multi-Image Composition ```bash uv run scripts/compose.py "prompt" output.png --refs image1.png image2.png ``` **Examples:** ```bash # Combine styles from multiple images uv run scripts/compose.py "Combine these styles into a logo" logo.png --refs style1.png style2.png ``` ## Workflows Workflows provide structured approaches for specific visual types. Each workflow follows the PAI 6-step editorial process: 1. **Extract narrative** - Understand the complete story/concept 2. **Derive visual concept** - Single metaphor with 2-3 physical objects 3. **Apply aesthetic** - Define style, colors, mood 4. **Construct prompt** - Build detailed generation instructions 5. **Generate** - Execute via script 6. **Validate** - Check against criteria, regenerate if needed ### Available Workflows - **infographic.md** - Data visualization, statistics, explainers - **diagram.md** - Technical diagrams, flowcharts, architecture ## Workflow Usage When generating images, follow the appropriate workflow: ### For Infographics ```markdown 1. What data/concept needs visualization? 2. What's the key insight or takeaway? 3. Aspect ratio: 16:9 (landscape) recommended 4. Include: clear hierarchy, minimal text, supporting icons 5. Generate at 2K minimum for text clarity ``` ### For Diagrams ```markdown 1. What system/process is being illustrated? 2. What are the key components and relationships? 3. Style: flat colors, clean lines, minimal detail 4. Generate at 2K for label clarity ``` ## Environment Setup Requires `GEMINI_API_KEY` environment variable. This should be set from Geoffrey's secrets: ```bash source ~/Library/Mobile\ Documents/com~apple~CloudDocs/Geoffrey/secrets/.env ``` ## Best Practices ### Infographics - Use simple, direct prompts: "Infographic explaining how X works" - Model auto-includes relevant icons/logos - 16:9 aspect ratio works best - Generate at 2K+ for readable text ### General - Multi-turn refinement: generate, then ask for specific changes - Reference images improve consistency - Be specific about style, mood, lighting - SynthID watermark is automatic (Google provenance) ## Output Location By default, save images to `/tmp/` or user-specified paths. For persistent storage, use: ``` ~/Library/Mobile Documents/com~apple~CloudDocs/Geoffrey/images/ ``` ## ⚠️ CRITICAL: Never Read Generated Images **DO NOT use the Read tool on generated images.** Why: - 4K images (3840x2160) are within the 8000px limit - 2K images (2560x1440) are also safe - BUT: Do not Read them - they're for user consumption, not analysis - For edits, use edit.py script, not Read tool Workflow: 1. Generate image with script 2. Return file path to user 3. User views the high-quality output ## Limitations - No photorealistic humans (safety filter) - No copyrighted characters - Maximum 14 reference images for composition - 4K only available with Nano Banana 2 and Nano Banana Pro ## Pricing | Size | Cost per Image | |------|---------------| | 1K | Free tier / $0.04 | | 2K | $0.134 | | 4K | $0.24 |
Related 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.