nano-banana
Google Gemini image generation (Nano Banana) via the Gemini API. Use when user mentions "Nano Banana", "Gemini image generation", "gemini-3-pro-image", "gemini-2.5-flash-image", or wants to generate/edit images with Google's native image model.
What this skill does
# Nano Banana (Gemini Image Generation)
Generate and edit images using Google's Gemini native image models. Supports text-to-image, image editing, and multi-image composition via the standard `generateContent` endpoint.
> Official docs: `https://ai.google.dev/gemini-api/docs/image-generation`
---
## When to Use
Use this skill when you need to:
- Generate images from text prompts
- Edit an existing image with a text instruction (inpaint / restyle / add-remove)
- Compose multiple input images into one output (e.g. put a product into a scene)
- Iterate on an image conversationally with fine-grained control
---
## Prerequisites
Connect the **Nano Banana** connector at [app.vm0.ai/connectors](https://app.vm0.ai/connectors). Enabling the connector provisions `NANO_BANANA_TOKEN` — no Google Cloud account or user-supplied key is required.
> **Troubleshooting:** If requests fail, run `zero doctor check-connector --env-name NANO_BANANA_TOKEN` or `zero doctor check-connector --url https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent --method POST`
---
## How to Use
All calls hit `POST https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent` with header `x-goog-api-key: $NANO_BANANA_TOKEN`. The output image comes back Base64-encoded in `candidates[0].content.parts[*].inline_data.data`.
### 1. Text-to-Image (Flash — fast, cheap default)
Write to `/tmp/nano_banana_request.json`:
```json
{
"contents": [
{
"parts": [
{ "text": "A golden retriever puppy wearing a tiny chef hat, studio lighting, photorealistic" }
]
}
]
}
```
```bash
curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" --header "x-goog-api-key: $NANO_BANANA_TOKEN" --header "Content-Type: application/json" -d @/tmp/nano_banana_request.json > /tmp/nano_banana_response.json
```
### 2. Text-to-Image (Pro — highest quality)
```bash
curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent" --header "x-goog-api-key: $NANO_BANANA_TOKEN" --header "Content-Type: application/json" -d @/tmp/nano_banana_request.json > /tmp/nano_banana_response.json
```
### 3. Extract and Save the Image
The response contains one or more parts; the image part has `inline_data.mime_type` starting with `image/`. Extract and decode:
```bash
jq -r '.candidates[0].content.parts[] | select(.inline_data != null) | .inline_data.data' /tmp/nano_banana_response.json | base64 -d > /tmp/nano_banana_output.png
```
### 4. Edit an Existing Image (Image-to-Image)
Pass the input image as a second part. Use a local file or URL → Base64:
```bash
base64 -w0 /path/to/input.jpg > /tmp/nano_banana_input_b64.txt
```
Write to `/tmp/nano_banana_request.json`:
```json
{
"contents": [
{
"parts": [
{ "text": "Replace the background with a snowy mountain range at sunset. Keep the subject unchanged." },
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "<PASTE_CONTENTS_OF_/tmp/nano_banana_input_b64.txt>"
}
}
]
}
]
}
```
Or build the JSON with `jq` to avoid pasting:
```bash
jq -n --rawfile img /tmp/nano_banana_input_b64.txt '{
contents: [{
parts: [
{ text: "Replace the background with a snowy mountain range at sunset. Keep the subject unchanged." },
{ inline_data: { mime_type: "image/jpeg", data: $img } }
]
}]
}' > /tmp/nano_banana_request.json
```
```bash
curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" --header "x-goog-api-key: $NANO_BANANA_TOKEN" --header "Content-Type: application/json" -d @/tmp/nano_banana_request.json > /tmp/nano_banana_response.json
```
### 5. Multi-Image Composition
Combine multiple input images into one output — e.g. put a product (image A) into a scene (image B):
```bash
jq -n \
--rawfile a /tmp/product_b64.txt \
--rawfile b /tmp/scene_b64.txt \
'{
contents: [{
parts: [
{ text: "Place the product from the first image onto the wooden table in the second image. Match the lighting and shadows." },
{ inline_data: { mime_type: "image/png", data: $a } },
{ inline_data: { mime_type: "image/jpeg", data: $b } }
]
}]
}' > /tmp/nano_banana_request.json
curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:generateContent" --header "x-goog-api-key: $NANO_BANANA_TOKEN" --header "Content-Type: application/json" -d @/tmp/nano_banana_request.json > /tmp/nano_banana_response.json
```
### 6. Control Output Modalities and Aspect Ratio
Gemini can return text alongside images. To request image-only output and a specific aspect ratio, add `generationConfig`:
```json
{
"contents": [
{ "parts": [{ "text": "A minimalist poster for a jazz festival" }] }
],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "2K"
}
}
}
```
```bash
curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" --header "x-goog-api-key: $NANO_BANANA_TOKEN" --header "Content-Type: application/json" -d @/tmp/nano_banana_request.json > /tmp/nano_banana_response.json
```
### 7. Conversational Editing (Multi-Turn Refinement)
Continue refining by appending the previous model turn and a new user message. Reuse the Base64 image the model returned so you don't re-upload:
```bash
PREV_IMG=$(jq -r '.candidates[0].content.parts[] | select(.inline_data != null) | .inline_data.data' /tmp/nano_banana_response.json)
jq -n --arg img "$PREV_IMG" '{
contents: [
{ role: "user", parts: [{ text: "A minimalist poster for a jazz festival" }] },
{ role: "model", parts: [{ inline_data: { mime_type: "image/png", data: $img } }] },
{ role: "user", parts: [{ text: "Make the typography bolder and shift the palette to deep blue and gold." }] }
]
}' > /tmp/nano_banana_request.json
curl -s -X POST "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image:generateContent" --header "x-goog-api-key: $NANO_BANANA_TOKEN" --header "Content-Type: application/json" -d @/tmp/nano_banana_request.json > /tmp/nano_banana_response.json
```
### 8. Inspect Any Text the Model Returns
The model may include a short text caption/explanation alongside the image:
```bash
jq -r '.candidates[0].content.parts[] | select(.text != null) | .text' /tmp/nano_banana_response.json
```
---
## Model Reference
| Model | Tier | Notes |
|---|---|---|
| `gemini-2.5-flash-image` | Fast | Default — good quality, low latency |
| `gemini-3.1-flash-image-preview` | Fast (newer) | Latest Flash preview |
| `gemini-3-pro-image-preview` | Pro | Highest quality, higher latency/cost |
## Aspect Ratios
`1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`, `1:4`, `4:1`, `1:8`, `8:1`.
## Image Size
`generationConfig.imageConfig.imageSize` — `"512"`, `"1K"` (default), `"2K"`, `"4K"`. Larger sizes cost more and are only relevant to final renders; keep iteration at `1K`.
## Response Shape
```json
{
"candidates": [{
"content": {
"parts": [
{ "text": "Optional caption..." },
{ "inline_data": { "mime_type": "image/png", "data": "<base64>" } }
]
},
"finishReason": "STOP"
}]
}
```
## Guidelines
1. **Endpoint is per-model** — the URL ends with `<model>:generateContent`. Don't try `/v1beta/models:generateContent` with a `model` field in the body; the firewall only allows the per-model endpoints.
2. **Use JSON files for request bodies** — write to `/tmp/nano_banana_*.json` to avoid shell quoting issues with long prompts and Base64 payloads.
3. **Always `base64 -w0`** when preparing Linux image input — `base64` without `-w0` inserts newlines that break JSON escaping.
4. **Output is Base64,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.