Multi-turn image generation with progressive refinement. Each turn builds on previous context, allowing iterative improvements without starting over.
Generates images through multi-turn conversations with progressive refinement and context persistence.
/plugin marketplace add dnvriend/gemini-nano-banana-tool/plugin install gemini-nano-banana-tool@gemini-nano-banana-toolMulti-turn image generation with progressive refinement. Each turn builds on previous context, allowing iterative improvements without starting over.
gemini-nano-banana-tool generate-conversation PROMPT -o OUTPUT [OPTIONS]
PROMPT - Text prompt for this turn (required)-o, --output PATH - Output image file path (required)-f, --file PATH - Conversation file (creates new if doesn't exist)-a, --aspect-ratio TEXT - Aspect ratio (default: 1:1, only for new conversations)-m, --model TEXT - Gemini model (default: gemini-2.5-flash-image, only for new)--api-key TEXT - Override API key from environment--use-vertex - Use Vertex AI instead of Developer API--project TEXT - Google Cloud project (for Vertex AI)--location TEXT - Google Cloud location (for Vertex AI)-v, --verbose - Multi-level verbosity (-v INFO, -vv DEBUG, -vvv TRACE)# Turn 1: Initial generation
gemini-nano-banana-tool generate-conversation "A sunset over mountains" \
-o sunset1.png --file conversation.json
# Turn 2: Refinement (loads conversation automatically)
gemini-nano-banana-tool generate-conversation "Make the sky more orange" \
-o sunset2.png --file conversation.json
# Turn 3: Further refinement
gemini-nano-banana-tool generate-conversation "Add a lake in the foreground" \
-o sunset3.png --file conversation.json
# Turn 1: Initial room
gemini-nano-banana-tool generate-conversation \
"A modern minimalist living room with large windows" \
-o room-v1.png --file interior.json -a 16:9
# Turn 2: Add furniture
gemini-nano-banana-tool generate-conversation \
"Add a gray sofa and wooden coffee table" \
-o room-v2.png --file interior.json
# Turn 3: Adjust lighting
gemini-nano-banana-tool generate-conversation \
"Make the lighting warmer and add floor lamp" \
-o room-v3.png --file interior.json
# Turn 4: Final touches
gemini-nano-banana-tool generate-conversation \
"Add plants and artwork on the walls" \
-o room-final.png --file interior.json
# Turn 1: Initial product shot
gemini-nano-banana-tool generate-conversation \
"Professional product photo of wireless headphones" \
-o headphones-v1.png --file product.json -a 1:1
# Turn 2: Adjust angle
gemini-nano-banana-tool generate-conversation \
"Rotate to show the left side" \
-o headphones-v2.png --file product.json
# Turn 3: Change background
gemini-nano-banana-tool generate-conversation \
"Change background to dark gradient" \
-o headphones-v3.png --file product.json
The conversation file stores complete history in JSON:
{
"conversation_id": "20251120_181305",
"model": "gemini-2.5-flash-image",
"aspect_ratio": "16:9",
"turns": [
{
"prompt": "A sunset over mountains",
"output_path": "/path/to/sunset1.png",
"reference_images": [],
"metadata": {
"token_count": 1295,
"resolution": "1344x768",
"finish_reason": "STOP"
},
"timestamp": "2025-11-20T18:13:11.428020"
},
{
"prompt": "Make the sky more orange",
"output_path": "/path/to/sunset2.png",
"reference_images": ["/path/to/sunset1.png"],
"metadata": {
"token_count": 1554,
"resolution": "1344x768",
"finish_reason": "STOP"
},
"timestamp": "2025-11-20T18:13:27.318416"
}
],
"created_at": "2025-11-20T18:13:05.751502",
"updated_at": "2025-11-20T18:13:27.318430"
}
-i needed)--file but conversation won't be savedEach turn costs the same as a single generation:
Cost is tracked per turn in conversation file metadata.
Set environment variable:
export GEMINI_API_KEY='your-api-key'
Get API key: https://aistudio.google.com/app/apikey