Nano Banana Pro
Generate or edit AI images with the NanoPhoto.AI Nano Banana Pro API via OpenClaw.
Generate or edit images through the NanoPhoto.AI Nano Banana Pro API.
Install: npx clawhub@latest install nano-banana-pro
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-pro": {
"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 8)
Important
The API only accepts public image URLs. Do not send local files or base64 images.
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 |
inputImageUrls | string[] | Conditional | Required for edit mode (max 8 URLs) |
Usage
Text to Image
python3 scripts/nano_banana_generate.py \
--prompt "A futuristic cityscape at sunset with flying cars and neon lights" \
--mode generate \
--aspect-ratio 16:9 \
--image-quality 2KImage to Image
python3 scripts/nano_banana_generate.py \
--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 1KThe script reads NANOPHOTO_API_KEY from the environment, submits the task, polls automatically, and prints the final JSON result.
Error 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 8 images | Reduce to 8 or fewer |
GENERATION_FAILED | Server error | Retry or simplify prompt |
وثائق NanoPhoto.AI