generate_image tool creates high-quality photorealistic images using an advanced AI image generation model.
generate_image
Generate or edit images using Gemini 3 Pro Image (Nano Banana Pro).Input Parameters
Image description or edit instructions. The prompt is automatically enhanced with professional photography and rendering techniques.
Output resolution:
1K- Standard resolution (1024px)2K- High resolution (2048px)4K- Ultra-high resolution (4096px)
Image aspect ratio:
1:1- Square3:4- Portrait (standard photo)4:3- Landscape (standard photo)9:16- Vertical (mobile/story)16:9- Widescreen (desktop/video)
Response
Returns image as base64-encoded data URI.Data URI with format:
data:image/png;base64,{base64_data}For LLM: Full data URI prefixed with IMAGE_GENERATED:For User: Confirmation message: I've generated the image based on your prompt: "{prompt}"Usage Examples
Basic generation:Prompt Enhancement
User prompts are automatically enhanced with professional art direction to ensure high-quality photorealistic output: Input prompt:Enhancement Features
Camera equipment simulation:- Professional camera bodies (Leica M11, Hasselblad X2D)
- Premium lens characteristics (85mm Prime f/1.2)
- Shallow depth of field and bokeh
- Rembrandt lighting for dramatic shadows
- Volumetric god rays for atmospheric depth
- High-key studio lighting options
- Cinematic rim lighting
- 8K resolution detail level
- Subsurface scattering for realistic skin/materials
- Octane Render quality standards
- Ray-traced global illumination
- Minimalist aesthetic
- Strong central subject focus
- Purposeful negative space
- Editorial and cinematic standards
- Avoids generic “AI art” aesthetics
- No purple/blue gradients or neon colors
- No colored shadows
- Natural, photorealistic output
File Handling
Temporary storage:- Generated images are saved to:
{workspace}/generated/gen-{timestamp}.png - Timestamp format:
20060102-150405(YYYYMMDD-HHMMSS) - Files are automatically deleted after conversion to data URI
Error Conditions
Image generation failed: {error}- Model API error or generation failureFailed to read generated image: {error}- File system error after generation
Implementation Details
Generation script:- Uses Python UV runtime for dependency management
- Script location:
/usr/lib/node_modules/openclaw/skills/nano-banana-pro/scripts/generate_image.py - Communicates with Gemini 3 Pro Image API
Configuration Requirements
API Key:- Tool requires valid API key for Gemini 3 Pro Image
- Configured during tool initialization
- Must have write permissions to workspace directory
- Requires
generated/subdirectory (created automatically)
- Python UV runtime
- Image generation script installation
- Network access to model API
Performance Considerations
Generation time by resolution:- 1K: ~5-10 seconds
- 2K: ~10-20 seconds
- 4K: ~20-40 seconds
- 1K: ~500 KB - 2 MB
- 2K: ~2 MB - 5 MB
- 4K: ~5 MB - 15 MB
Generation times are approximate and depend on prompt complexity, API load, and network latency.
Best Practices
Prompt writing:- Be specific and descriptive
- Mention style, mood, and setting
- Enhancement handles technical details automatically
- “Mountain landscape at golden hour with dramatic clouds”
- “Close-up portrait of elderly man with weathered face”
- “Modern minimalist living room with natural light”
- “Nice picture” (too generic)
- “Something cool” (no direction)
- “AI art” (conflicts with enhancement style)
- Use 1K for quick previews and web display
- Use 2K for high-quality prints and presentations
- Use 4K for maximum detail and professional use
- 1:1 - Social media posts, profile pictures
- 3:4 - Portrait photography, print photos
- 4:3 - Traditional displays, presentations
- 9:16 - Mobile apps, Instagram stories
- 16:9 - Desktop wallpapers, video thumbnails