Nano Banana 2
Generate or edit images with Google Search enhancement via the NanoPhoto.AI Nano Banana 2 API and OpenClaw.
Generate or edit images through the NanoPhoto.AI Nano Banana 2 API, with optional Google Search prompt enhancement.
Install: npx clawhub@latest install nano-banana-2
ClawHub: clawhub.ai/u/nanophotohq
Prerequisites
- Obtain an API key at nanophoto.ai/settings/apikeys
- Configure
NANOPHOTO_API_KEYin your OpenClaw skill settings
{
"skills": {
"entries": {
"nano-banana-2": {
"enabled": true,
"env": {
"NANOPHOTO_API_KEY": "your_api_key_here"
}
}
}
}
}Modes
- generate — Text-to-image generation
- edit — Image-to-image editing (requires public image URLs, max 14)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Image generation prompt |
mode | string | Yes | generate or edit |
aspectRatio | string | No | 16:9, 9:16, 4:3, or 3:4 |
imageQuality | string | No | 1K (default), 2K, or 4K |
googleSearch | boolean | No | Enable Google Search prompt enhancement |
inputImageUrls | string[] | Conditional | Required for edit mode (max 14 URLs) |
Usage
Text to Image
python3 scripts/nano_banana_2.py submit \
--prompt "A futuristic cityscape at sunset with flying cars" \
--mode generate \
--aspect-ratio 16:9 \
--image-quality 2KWith Google Search Enhancement
python3 scripts/nano_banana_2.py submit \
--prompt "The latest Tesla Cybertruck in a desert landscape" \
--mode generate \
--aspect-ratio 16:9 \
--image-quality 2K \
--google-search \
--followImage to Image
python3 scripts/nano_banana_2.py submit \
--prompt "Transform this photo into a watercolor painting style" \
--mode edit \
--input-image-url https://example.com/photo.webp \
--aspect-ratio 16:9 \
--image-quality 1KCheck Status
python3 scripts/nano_banana_2.py status --generation-id abc123xyzError Codes
| Code | Cause | Action |
|---|---|---|
LOGIN_REQUIRED | Invalid API key | Verify at settings/apikeys |
INSUFFICIENT_CREDITS | Not enough credits | Top up |
INVALID_PROMPT | Missing prompt | Provide a prompt |
MISSING_INPUT_IMAGE | Edit mode missing images | Provide public image URLs |
TOO_MANY_IMAGES | More than 14 images | Reduce to 14 or fewer |
GENERATION_FAILED | Server error | Retry or simplify prompt |
Docs NanoPhoto.AI