antigravity-seo-kit 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/agent.md +96 -0
- package/.agent/skills/seo/SKILL.md +153 -0
- package/.agent/skills/seo/references/cwv-thresholds.md +108 -0
- package/.agent/skills/seo/references/eeat-framework.md +214 -0
- package/.agent/skills/seo/references/local-schema-types.md +230 -0
- package/.agent/skills/seo/references/local-seo-signals.md +218 -0
- package/.agent/skills/seo/references/maps-api-endpoints.md +160 -0
- package/.agent/skills/seo/references/maps-free-apis.md +176 -0
- package/.agent/skills/seo/references/maps-gbp-checklist.md +150 -0
- package/.agent/skills/seo/references/maps-geo-grid.md +154 -0
- package/.agent/skills/seo/references/quality-gates.md +155 -0
- package/.agent/skills/seo/references/schema-types.md +118 -0
- package/.agent/skills/seo/schema/templates.json +213 -0
- package/.agent/skills/seo/scripts/analyze_visual.py +217 -0
- package/.agent/skills/seo/scripts/capture_screenshot.py +181 -0
- package/.agent/skills/seo/scripts/fetch_page.py +196 -0
- package/.agent/skills/seo/scripts/parse_html.py +201 -0
- package/.agent/skills/seo-audit/SKILL.md +278 -0
- package/.agent/skills/seo-competitor-pages/SKILL.md +212 -0
- package/.agent/skills/seo-content/SKILL.md +230 -0
- package/.agent/skills/seo-dataforseo/SKILL.md +418 -0
- package/.agent/skills/seo-geo/SKILL.md +305 -0
- package/.agent/skills/seo-google/SKILL.md +405 -0
- package/.agent/skills/seo-google/assets/templates/cwv-audit-report.md +48 -0
- package/.agent/skills/seo-google/assets/templates/gsc-performance-report.md +44 -0
- package/.agent/skills/seo-google/assets/templates/indexation-status-report.md +43 -0
- package/.agent/skills/seo-google/references/auth-setup.md +154 -0
- package/.agent/skills/seo-google/references/ga4-data-api.md +184 -0
- package/.agent/skills/seo-google/references/indexing-api.md +107 -0
- package/.agent/skills/seo-google/references/keyword-planner-api.md +66 -0
- package/.agent/skills/seo-google/references/nlp-api.md +55 -0
- package/.agent/skills/seo-google/references/pagespeed-crux-api.md +204 -0
- package/.agent/skills/seo-google/references/rate-limits-quotas.md +75 -0
- package/.agent/skills/seo-google/references/search-console-api.md +156 -0
- package/.agent/skills/seo-google/references/supplementary-apis.md +99 -0
- package/.agent/skills/seo-google/references/youtube-api.md +49 -0
- package/.agent/skills/seo-google/scripts/crux_history.py +321 -0
- package/.agent/skills/seo-google/scripts/ga4_report.py +478 -0
- package/.agent/skills/seo-google/scripts/google_auth.py +795 -0
- package/.agent/skills/seo-google/scripts/google_report.py +2273 -0
- package/.agent/skills/seo-google/scripts/gsc_inspect.py +340 -0
- package/.agent/skills/seo-google/scripts/gsc_query.py +378 -0
- package/.agent/skills/seo-google/scripts/indexing_notify.py +313 -0
- package/.agent/skills/seo-google/scripts/keyword_planner.py +297 -0
- package/.agent/skills/seo-google/scripts/nlp_analyze.py +309 -0
- package/.agent/skills/seo-google/scripts/pagespeed_check.py +649 -0
- package/.agent/skills/seo-google/scripts/youtube_search.py +355 -0
- package/.agent/skills/seo-hreflang/SKILL.md +192 -0
- package/.agent/skills/seo-image-gen/SKILL.md +211 -0
- package/.agent/skills/seo-image-gen/references/cost-tracking.md +47 -0
- package/.agent/skills/seo-image-gen/references/gemini-models.md +200 -0
- package/.agent/skills/seo-image-gen/references/mcp-tools.md +115 -0
- package/.agent/skills/seo-image-gen/references/post-processing.md +192 -0
- package/.agent/skills/seo-image-gen/references/presets.md +69 -0
- package/.agent/skills/seo-image-gen/references/prompt-engineering.md +411 -0
- package/.agent/skills/seo-image-gen/references/seo-image-presets.md +137 -0
- package/.agent/skills/seo-image-gen/scripts/batch.py +97 -0
- package/.agent/skills/seo-image-gen/scripts/cost_tracker.py +191 -0
- package/.agent/skills/seo-image-gen/scripts/edit.py +141 -0
- package/.agent/skills/seo-image-gen/scripts/generate.py +149 -0
- package/.agent/skills/seo-image-gen/scripts/presets.py +153 -0
- package/.agent/skills/seo-image-gen/scripts/setup_mcp.py +151 -0
- package/.agent/skills/seo-image-gen/scripts/validate_setup.py +133 -0
- package/.agent/skills/seo-images/SKILL.md +176 -0
- package/.agent/skills/seo-local/SKILL.md +381 -0
- package/.agent/skills/seo-maps/SKILL.md +328 -0
- package/.agent/skills/seo-page/SKILL.md +86 -0
- package/.agent/skills/seo-plan/SKILL.md +118 -0
- package/.agent/skills/seo-plan/assets/agency.md +175 -0
- package/.agent/skills/seo-plan/assets/ecommerce.md +167 -0
- package/.agent/skills/seo-plan/assets/generic.md +144 -0
- package/.agent/skills/seo-plan/assets/local-service.md +160 -0
- package/.agent/skills/seo-plan/assets/publisher.md +153 -0
- package/.agent/skills/seo-plan/assets/saas.md +135 -0
- package/.agent/skills/seo-programmatic/SKILL.md +171 -0
- package/.agent/skills/seo-schema/SKILL.md +223 -0
- package/.agent/skills/seo-sitemap/SKILL.md +180 -0
- package/.agent/skills/seo-technical/SKILL.md +211 -0
- package/.agent/workflows/seo-audit.md +17 -0
- package/.agent/workflows/seo-competitor-pages.md +12 -0
- package/.agent/workflows/seo-content.md +14 -0
- package/.agent/workflows/seo-geo.md +12 -0
- package/.agent/workflows/seo-google.md +12 -0
- package/.agent/workflows/seo-hreflang.md +12 -0
- package/.agent/workflows/seo-images.md +13 -0
- package/.agent/workflows/seo-local.md +12 -0
- package/.agent/workflows/seo-maps.md +11 -0
- package/.agent/workflows/seo-page.md +13 -0
- package/.agent/workflows/seo-plan.md +13 -0
- package/.agent/workflows/seo-programmatic.md +12 -0
- package/.agent/workflows/seo-schema.md +11 -0
- package/.agent/workflows/seo-sitemap.md +9 -0
- package/.agent/workflows/seo-technical.md +18 -0
- package/LICENSE +88 -0
- package/README.md +122 -0
- package/bin/cli.js +117 -0
- package/docs/ARCHITECTURE.md +218 -0
- package/docs/COMMANDS.md +184 -0
- package/docs/INSTALLATION.md +100 -0
- package/docs/MCP-INTEGRATION.md +153 -0
- package/docs/TROUBLESHOOTING.md +151 -0
- package/docs/superpowers/plans/2026-03-13-github-audit-fixes.md +511 -0
- package/extensions/banana/README.md +95 -0
- package/extensions/banana/docs/BANANA-SETUP.md +86 -0
- package/extensions/banana/install.sh +170 -0
- package/extensions/banana/references/cost-tracking.md +47 -0
- package/extensions/banana/references/gemini-models.md +200 -0
- package/extensions/banana/references/mcp-tools.md +115 -0
- package/extensions/banana/references/post-processing.md +192 -0
- package/extensions/banana/references/presets.md +69 -0
- package/extensions/banana/references/prompt-engineering.md +411 -0
- package/extensions/banana/references/seo-image-presets.md +137 -0
- package/extensions/banana/scripts/batch.py +97 -0
- package/extensions/banana/scripts/cost_tracker.py +191 -0
- package/extensions/banana/scripts/edit.py +141 -0
- package/extensions/banana/scripts/generate.py +149 -0
- package/extensions/banana/scripts/presets.py +153 -0
- package/extensions/banana/scripts/setup_mcp.py +151 -0
- package/extensions/banana/scripts/validate_setup.py +133 -0
- package/extensions/banana/uninstall.sh +43 -0
- package/extensions/dataforseo/README.md +169 -0
- package/extensions/dataforseo/docs/DATAFORSEO-SETUP.md +74 -0
- package/extensions/dataforseo/field-config.json +280 -0
- package/extensions/dataforseo/install.ps1 +110 -0
- package/extensions/dataforseo/install.sh +161 -0
- package/extensions/dataforseo/uninstall.ps1 +35 -0
- package/extensions/dataforseo/uninstall.sh +39 -0
- package/lib/api.js +190 -0
- package/lib/fingerprint.js +68 -0
- package/lib/installer.js +486 -0
- package/lib/utils.js +254 -0
- package/package.json +40 -0
- package/pyproject.toml +11 -0
- package/requirements-google.txt +15 -0
- package/requirements.txt +11 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Banana Image Generation Extension Installer for SEO Kit
|
|
5
|
+
# Wraps everything in main() to prevent partial execution on network failure
|
|
6
|
+
|
|
7
|
+
main() {
|
|
8
|
+
SKILL_DIR=".agent/skills/seo-image-gen"
|
|
9
|
+
AGENT_DIR=".agent/skills"
|
|
10
|
+
SEO_SKILL_DIR=".agent/skills/seo"
|
|
11
|
+
SETTINGS_FILE="MCP_settings_path"
|
|
12
|
+
|
|
13
|
+
echo "════════════════════════════════════════"
|
|
14
|
+
echo "║ Banana Image Gen - SEO Extension ║"
|
|
15
|
+
echo "║ For SEO Kit ║"
|
|
16
|
+
echo "════════════════════════════════════════"
|
|
17
|
+
echo ""
|
|
18
|
+
|
|
19
|
+
# Check prerequisites
|
|
20
|
+
if [ ! -d "${SEO_SKILL_DIR}" ]; then
|
|
21
|
+
echo "✗ SEO Kit is not installed."
|
|
22
|
+
echo " Install it first: curl -fsSL https://raw.githubusercontent.com/AgriciDaniel/seo-kit/main/install.sh | bash"
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
echo "✓ SEO Kit detected"
|
|
26
|
+
|
|
27
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
28
|
+
echo "✗ Node.js is required but not installed."
|
|
29
|
+
echo " Install Node.js 20+: https://nodejs.org/"
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
NODE_VERSION=$(node -v | sed 's/v//' | cut -d. -f1)
|
|
34
|
+
if [ "${NODE_VERSION}" -lt 20 ]; then
|
|
35
|
+
echo "✗ Node.js 20+ required (found v${NODE_VERSION})."
|
|
36
|
+
echo " Update: https://nodejs.org/"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
echo "✓ Node.js v$(node -v | sed 's/v//') detected"
|
|
40
|
+
|
|
41
|
+
if ! command -v npx >/dev/null 2>&1; then
|
|
42
|
+
echo "✗ npx is required but not found (comes with npm)."
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
echo "✓ npx detected"
|
|
46
|
+
|
|
47
|
+
# Determine script directory (works for both ./install.sh and repo-relative paths)
|
|
48
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
49
|
+
|
|
50
|
+
# Check if running from repo or standalone
|
|
51
|
+
if [ -f "${SCRIPT_DIR}/skills/seo-image-gen/SKILL.md" ]; then
|
|
52
|
+
SOURCE_DIR="${SCRIPT_DIR}"
|
|
53
|
+
elif [ -f "${SCRIPT_DIR}/extensions/banana/skills/seo-image-gen/SKILL.md" ]; then
|
|
54
|
+
SOURCE_DIR="${SCRIPT_DIR}/extensions/banana"
|
|
55
|
+
else
|
|
56
|
+
echo "✗ Cannot find extension source files."
|
|
57
|
+
echo " Run this script from the seo-kit repo: ./extensions/banana/install.sh"
|
|
58
|
+
exit 1
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
# Check if nanobanana-mcp is already configured
|
|
62
|
+
MCP_CONFIGURED=false
|
|
63
|
+
if [ -f "${SETTINGS_FILE}" ]; then
|
|
64
|
+
if python3 -c "
|
|
65
|
+
import json
|
|
66
|
+
with open('${SETTINGS_FILE}', 'r') as f:
|
|
67
|
+
settings = json.load(f)
|
|
68
|
+
if 'mcpServers' in settings and 'nanobanana-mcp' in settings['mcpServers']:
|
|
69
|
+
exit(0)
|
|
70
|
+
else:
|
|
71
|
+
exit(1)
|
|
72
|
+
" 2>/dev/null; then
|
|
73
|
+
MCP_CONFIGURED=true
|
|
74
|
+
echo "✓ nanobanana-mcp already configured in settings.json"
|
|
75
|
+
fi
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# If MCP not configured, prompt for API key
|
|
79
|
+
if [ "${MCP_CONFIGURED}" = false ]; then
|
|
80
|
+
echo ""
|
|
81
|
+
echo "Google AI API key required for image generation."
|
|
82
|
+
echo "Get a free key at: https://aistudio.google.com/apikey"
|
|
83
|
+
echo ""
|
|
84
|
+
|
|
85
|
+
read -rsp "Google AI API key (GOOGLE_AI_API_KEY): " GOOGLE_AI_API_KEY
|
|
86
|
+
echo ""
|
|
87
|
+
if [ -z "${GOOGLE_AI_API_KEY}" ]; then
|
|
88
|
+
echo "✗ API key cannot be empty."
|
|
89
|
+
exit 1
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
# Configure MCP server
|
|
93
|
+
echo "→ Configuring nanobanana-mcp server..."
|
|
94
|
+
python3 -c "
|
|
95
|
+
import json, os
|
|
96
|
+
|
|
97
|
+
settings_path = '${SETTINGS_FILE}'
|
|
98
|
+
|
|
99
|
+
# Read existing settings or create new
|
|
100
|
+
if os.path.exists(settings_path):
|
|
101
|
+
with open(settings_path, 'r') as f:
|
|
102
|
+
settings = json.load(f)
|
|
103
|
+
else:
|
|
104
|
+
settings = {}
|
|
105
|
+
|
|
106
|
+
# Ensure mcpServers key exists
|
|
107
|
+
if 'mcpServers' not in settings:
|
|
108
|
+
settings['mcpServers'] = {}
|
|
109
|
+
|
|
110
|
+
# Add nanobanana-mcp server config
|
|
111
|
+
settings['mcpServers']['nanobanana-mcp'] = {
|
|
112
|
+
'command': 'npx',
|
|
113
|
+
'args': ['-y', '@ycse/nanobanana-mcp@latest'],
|
|
114
|
+
'env': {
|
|
115
|
+
'GOOGLE_AI_API_KEY': '''${GOOGLE_AI_API_KEY}'''
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# Write back
|
|
120
|
+
os.makedirs(os.path.dirname(settings_path), exist_ok=True)
|
|
121
|
+
with open(settings_path, 'w') as f:
|
|
122
|
+
json.dump(settings, f, indent=2)
|
|
123
|
+
|
|
124
|
+
print(' ✓ nanobanana-mcp configured in settings.json')
|
|
125
|
+
" || {
|
|
126
|
+
echo "✗ Could not auto-configure MCP server."
|
|
127
|
+
echo " See: extensions/banana/docs/BANANA-SETUP.md"
|
|
128
|
+
exit 1
|
|
129
|
+
}
|
|
130
|
+
fi
|
|
131
|
+
|
|
132
|
+
# Install skill
|
|
133
|
+
echo ""
|
|
134
|
+
echo "→ Installing seo-image-gen skill..."
|
|
135
|
+
mkdir -p "${SKILL_DIR}"
|
|
136
|
+
cp "${SOURCE_DIR}/skills/seo-image-gen/SKILL.md" "${SKILL_DIR}/SKILL.md"
|
|
137
|
+
|
|
138
|
+
# Install agent
|
|
139
|
+
echo "→ Installing seo-image-gen agent..."
|
|
140
|
+
mkdir -p "${AGENT_DIR}"
|
|
141
|
+
cp "${SOURCE_DIR}/agents/seo-image-gen.md" "${AGENT_DIR}/seo-image-gen.md"
|
|
142
|
+
|
|
143
|
+
# Copy scripts and references to skill directory for ${CLAUDE_SKILL_DIR} resolution
|
|
144
|
+
echo "→ Installing scripts and references..."
|
|
145
|
+
mkdir -p "${SKILL_DIR}/scripts" "${SKILL_DIR}/references"
|
|
146
|
+
cp "${SOURCE_DIR}/scripts/"*.py "${SKILL_DIR}/scripts/"
|
|
147
|
+
cp "${SOURCE_DIR}/references/"*.md "${SKILL_DIR}/references/"
|
|
148
|
+
|
|
149
|
+
# Pre-warm npx package
|
|
150
|
+
echo "→ Pre-downloading nanobanana-mcp..."
|
|
151
|
+
npx -y @ycse/nanobanana-mcp@latest --help >/dev/null 2>&1 || true
|
|
152
|
+
|
|
153
|
+
echo ""
|
|
154
|
+
echo "✓ Banana Image Generation extension installed successfully!"
|
|
155
|
+
echo ""
|
|
156
|
+
echo "Usage:"
|
|
157
|
+
echo " 1. Open your workspace in your AI agent"
|
|
158
|
+
echo " 2. Run commands:"
|
|
159
|
+
echo " /seo image-gen og \"Professional SaaS dashboard\""
|
|
160
|
+
echo " /seo image-gen hero \"Dramatic sunset over city skyline\""
|
|
161
|
+
echo " /seo image-gen product \"Wireless headphones on marble\""
|
|
162
|
+
echo " /seo image-gen infographic \"SEO ranking factors 2026\""
|
|
163
|
+
echo " /seo image-gen custom \"Any creative concept\""
|
|
164
|
+
echo " /seo image-gen batch \"Product variations\" 3"
|
|
165
|
+
echo ""
|
|
166
|
+
echo "Full docs: extensions/banana/README.md"
|
|
167
|
+
echo "To uninstall: ./extensions/banana/uninstall.sh"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
main "$@"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Cost Tracking Reference
|
|
2
|
+
|
|
3
|
+
> Load this on-demand when the user asks about costs or before batch operations.
|
|
4
|
+
|
|
5
|
+
## Pricing Table
|
|
6
|
+
|
|
7
|
+
| Model | Resolution | Cost/Image | Notes |
|
|
8
|
+
|-------|-----------|-----------|-------|
|
|
9
|
+
| 3.1 Flash | 512 | $0.020 | Quick drafts |
|
|
10
|
+
| 3.1 Flash | 1K | $0.039 | Standard (default) |
|
|
11
|
+
| 3.1 Flash | 2K | $0.078 | Quality assets |
|
|
12
|
+
| 3.1 Flash | 4K | $0.156 | Print/hero images |
|
|
13
|
+
| 2.5 Flash | 512 | $0.020 | Draft fallback |
|
|
14
|
+
| 2.5 Flash | 1K | $0.039 | Standard fallback |
|
|
15
|
+
| Batch API | Any | 50% of above | Asynchronous, higher latency |
|
|
16
|
+
|
|
17
|
+
Pricing is approximate, based on ~1,290 output tokens per image.
|
|
18
|
+
Research suggests actual costs may be ~$0.067/img. Verify at https://ai.google.dev/gemini-api/docs/pricing
|
|
19
|
+
|
|
20
|
+
## Free Tier Limits
|
|
21
|
+
|
|
22
|
+
- ~10 requests per minute (RPM)
|
|
23
|
+
- ~500 requests per day (RPD)
|
|
24
|
+
- Per Google Cloud project, resets midnight Pacific
|
|
25
|
+
|
|
26
|
+
## Cost Tracker Commands
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Log a generation
|
|
30
|
+
cost_tracker.py log --model gemini-3.1-flash-image-preview --resolution 1K --prompt "coffee shop hero"
|
|
31
|
+
|
|
32
|
+
# View summary (total + last 7 days)
|
|
33
|
+
cost_tracker.py summary
|
|
34
|
+
|
|
35
|
+
# Today's usage
|
|
36
|
+
cost_tracker.py today
|
|
37
|
+
|
|
38
|
+
# Estimate before batch
|
|
39
|
+
cost_tracker.py estimate --model gemini-3.1-flash-image-preview --resolution 1K --count 10
|
|
40
|
+
|
|
41
|
+
# Reset ledger
|
|
42
|
+
cost_tracker.py reset --confirm
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Storage
|
|
46
|
+
|
|
47
|
+
Ledger stored at `~/.banana/costs.json`. Created automatically on first use.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Gemini Image Generation Models
|
|
2
|
+
|
|
3
|
+
> Last updated: 2026-03-13
|
|
4
|
+
> Aligned with Google's March 2026 API state
|
|
5
|
+
|
|
6
|
+
## Available Models
|
|
7
|
+
|
|
8
|
+
### gemini-3.1-flash-image-preview (Recommended)
|
|
9
|
+
| Property | Value |
|
|
10
|
+
|----------|-------|
|
|
11
|
+
| **Model ID** | `gemini-3.1-flash-image-preview` |
|
|
12
|
+
| **Tier** | Nano Banana 2 (Flash) |
|
|
13
|
+
| **Speed** | Fast - optimized for high-volume use |
|
|
14
|
+
| **Aspect Ratios** | All 14 ratios (see table below) |
|
|
15
|
+
| **Max Resolution** | Up to 4096×4096 (4K tier) |
|
|
16
|
+
| **Features** | Google Search grounding (web + image), thinking levels, image-only output, extreme aspect ratios |
|
|
17
|
+
| **Rate Limits (Free)** | ~10 RPM / ~500 RPD (per Google Cloud project, resets midnight Pacific) |
|
|
18
|
+
| **Output Tokens** | ~1,290 output tokens per image |
|
|
19
|
+
| **Best For** | Most use cases, rapid iteration, batch generation |
|
|
20
|
+
|
|
21
|
+
### gemini-2.5-flash-image
|
|
22
|
+
| Property | Value |
|
|
23
|
+
|----------|-------|
|
|
24
|
+
| **Model ID** | `gemini-2.5-flash-image` |
|
|
25
|
+
| **Tier** | Nano Banana 2 (Flash, previous gen) |
|
|
26
|
+
| **Speed** | Fast |
|
|
27
|
+
| **Aspect Ratios** | 1:1, 16:9, 9:16, 4:3, 3:4 |
|
|
28
|
+
| **Max Resolution** | Up to 1024×1024 (1K tier) |
|
|
29
|
+
| **Rate Limits (Free)** | ~10 RPM / ~500 RPD |
|
|
30
|
+
| **Best For** | Stable fallback, proven quality |
|
|
31
|
+
|
|
32
|
+
## Deprecated Models (DO NOT USE)
|
|
33
|
+
|
|
34
|
+
### gemini-3-pro-image-preview
|
|
35
|
+
- **Status:** Base model deprecated March 9, 2026. **Image generation variant may still be accessible**. Use at your own discretion via `set_model`. Prefer 3.1 Flash.
|
|
36
|
+
- **Was:** Nano Banana Pro tier (professional asset production, 4K output, 14 reference images)
|
|
37
|
+
- **Migration:** Use `gemini-3.1-flash-image-preview` instead
|
|
38
|
+
|
|
39
|
+
### gemini-2.0-flash-exp
|
|
40
|
+
- **Status:** Deprecated, replaced by gemini-2.5-flash-image
|
|
41
|
+
|
|
42
|
+
## Aspect Ratios
|
|
43
|
+
|
|
44
|
+
All 14 supported ratios. Availability varies by model:
|
|
45
|
+
|
|
46
|
+
| Ratio | Orientation | Use Cases | 3.1 Flash | 2.5 Flash |
|
|
47
|
+
|-------|-------------|-----------|:---------:|:---------:|
|
|
48
|
+
| `1:1` | Square | Social posts, avatars, thumbnails | ✅ | ✅ |
|
|
49
|
+
| `16:9` | Landscape | Blog headers, YouTube thumbnails, presentations | ✅ | ✅ |
|
|
50
|
+
| `9:16` | Portrait | Stories, Reels, TikTok, mobile | ✅ | ✅ |
|
|
51
|
+
| `4:3` | Landscape | Product shots, classic display | ✅ | ✅ |
|
|
52
|
+
| `3:4` | Portrait | Book covers, portrait framing | ✅ | ✅ |
|
|
53
|
+
| `2:3` | Portrait | Pinterest pins, posters | ✅ | ❌ |
|
|
54
|
+
| `3:2` | Landscape | DSLR standard, photo prints | ✅ | ❌ |
|
|
55
|
+
| `4:5` | Portrait | Instagram portrait, social | ✅ | ❌ |
|
|
56
|
+
| `5:4` | Landscape | Large format photography | ✅ | ❌ |
|
|
57
|
+
| `1:4` | Tall strip | Vertical banners, side panels | ✅ | ❌ |
|
|
58
|
+
| `4:1` | Wide strip | Website banners, headers | ✅ | ❌ |
|
|
59
|
+
| `1:8` | Extreme tall | Narrow vertical strips | ✅ | ❌ |
|
|
60
|
+
| `8:1` | Extreme wide | Ultra-wide banners | ✅ | ❌ |
|
|
61
|
+
| `21:9` | Ultra-wide | Cinematic, film-grade, ultra-wide monitors | ✅ | ❌ |
|
|
62
|
+
|
|
63
|
+
## Resolution Tiers
|
|
64
|
+
|
|
65
|
+
Control output resolution with the `imageSize` parameter. Note the **uppercase K** requirement.
|
|
66
|
+
|
|
67
|
+
| `imageSize` Value | Pixel Range | Model Availability | Use Case |
|
|
68
|
+
|-------------------|-------------|-------------------|----------|
|
|
69
|
+
| `512` | Up to 512×512 | All models | Drafts, quick iteration, low bandwidth |
|
|
70
|
+
| `1K` (default) | Up to 1024×1024 | All models | Standard web use, social media |
|
|
71
|
+
| `2K` | Up to 2048×2048 | 3.1 Flash | Quality assets, detailed work |
|
|
72
|
+
| `4K` | Up to 4096×4096 | 3.1 Flash | Print production, hero images, final assets |
|
|
73
|
+
|
|
74
|
+
**Notes:**
|
|
75
|
+
- Actual pixel dimensions depend on aspect ratio (e.g., 4K at 16:9 = 4096×2304)
|
|
76
|
+
- Higher resolutions consume more tokens and cost more
|
|
77
|
+
- Default is `1K` if `imageSize` is not specified
|
|
78
|
+
|
|
79
|
+
## API Configuration
|
|
80
|
+
|
|
81
|
+
### Endpoint
|
|
82
|
+
```
|
|
83
|
+
https://generativelanguage.googleapis.com/v1beta/models/{model-id}:generateContent
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Required Parameters
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"contents": [{"parts": [{"text": "your prompt here"}]}],
|
|
90
|
+
"generationConfig": {
|
|
91
|
+
"responseModalities": ["TEXT", "IMAGE"],
|
|
92
|
+
"imageConfig": {
|
|
93
|
+
"aspectRatio": "16:9",
|
|
94
|
+
"imageSize": "1K"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Image-Only Output Mode
|
|
101
|
+
Force the model to return only an image (no text response):
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"generationConfig": {
|
|
105
|
+
"responseModalities": ["IMAGE"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Thinking Level
|
|
111
|
+
Control how much the model "thinks" before generating. Higher levels improve complex compositions but increase latency:
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"generationConfig": {
|
|
115
|
+
"thinkingConfig": {
|
|
116
|
+
"thinkingLevel": "medium"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
Levels: `minimal`, `low`, `medium`, `high`
|
|
122
|
+
|
|
123
|
+
### Google Search Grounding
|
|
124
|
+
Ground generation in real-world visual references. Supports web and image search (3.1 Flash):
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"tools": [{"googleSearch": {}}]
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
**Prompt pattern:** `[Search/source request] + [Analytical task] + [Visual translation]`
|
|
131
|
+
|
|
132
|
+
Example: "Search for the latest SpaceX Starship design, analyze its proportions and markings, then generate a photorealistic image of it at sunset on the launch pad."
|
|
133
|
+
|
|
134
|
+
### Multi-Image Input
|
|
135
|
+
Up to 14 reference images can be provided:
|
|
136
|
+
- **10 object references**: for style, composition, or visual matching
|
|
137
|
+
- **4 character references**: assign distinct names to preserve features across generations
|
|
138
|
+
|
|
139
|
+
Useful for character consistency, style transfer, and brand-aligned generation.
|
|
140
|
+
|
|
141
|
+
## Rate Limits by Tier
|
|
142
|
+
|
|
143
|
+
| Tier | RPM | RPD | Notes |
|
|
144
|
+
|------|-----|-----|-------|
|
|
145
|
+
| Free | ~10 | ~500 | Per Google Cloud project, resets midnight Pacific. Reduced Dec 2025. |
|
|
146
|
+
| Pay-as-you-go | 30 | 10,000 | Production workloads |
|
|
147
|
+
| Enterprise | Custom | Custom | Contact Google |
|
|
148
|
+
|
|
149
|
+
## Pricing
|
|
150
|
+
|
|
151
|
+
| Model | Resolution | Cost per Image | Notes |
|
|
152
|
+
|-------|-----------|---------------|-------|
|
|
153
|
+
| 3.1 Flash | 1K | ~$0.039 | Standard |
|
|
154
|
+
| 3.1 Flash | 2K | ~$0.078 | 2× standard |
|
|
155
|
+
| 3.1 Flash | 4K | ~$0.156 | 4× standard |
|
|
156
|
+
| 2.5 Flash | 1K | ~$0.039 | Standard |
|
|
157
|
+
| Batch API | Any | 50% discount | Asynchronous, higher latency |
|
|
158
|
+
|
|
159
|
+
Pricing is approximate and based on ~1,290 output tokens per image.
|
|
160
|
+
Research suggests NB2 pricing may be ~$0.067/img (vs documented $0.039). Verify current pricing at https://ai.google.dev/gemini-api/docs/pricing
|
|
161
|
+
|
|
162
|
+
## Image Output Specs
|
|
163
|
+
|
|
164
|
+
| Property | Value |
|
|
165
|
+
|----------|-------|
|
|
166
|
+
| **Format** | PNG |
|
|
167
|
+
| **Max Resolution** | Up to 4096×4096 (4K tier, 3.1 Flash) |
|
|
168
|
+
| **Color Space** | sRGB |
|
|
169
|
+
| **Text Rendering** | Supported - best under 25 characters |
|
|
170
|
+
| **Style Control** | Via prompt engineering |
|
|
171
|
+
|
|
172
|
+
## Safety Filters
|
|
173
|
+
|
|
174
|
+
Gemini uses a two-layer safety architecture:
|
|
175
|
+
|
|
176
|
+
1. **Input filters**: block prompts containing prohibited content before generation
|
|
177
|
+
2. **Output filters**: analyze generated images and block unsafe results
|
|
178
|
+
|
|
179
|
+
| `finishReason` | Meaning | Retryable? |
|
|
180
|
+
|----------------|---------|:----------:|
|
|
181
|
+
| `STOP` | Successful generation | N/A |
|
|
182
|
+
| `IMAGE_SAFETY` | Output blocked by safety filter | Rephrase prompt |
|
|
183
|
+
| `PROHIBITED_CONTENT` | Content policy violation | No - topic is blocked |
|
|
184
|
+
| `SAFETY` | General safety block | Rephrase prompt |
|
|
185
|
+
| `RECITATION` | Detected copyrighted content | Rephrase prompt |
|
|
186
|
+
|
|
187
|
+
**Known issue:** Filters are known to be overly cautious. Benign prompts may be blocked. Iterate with rephrased wording if this happens.
|
|
188
|
+
|
|
189
|
+
## Content Credentials
|
|
190
|
+
|
|
191
|
+
- **SynthID watermarks** are always embedded in generated images (invisible, machine-readable)
|
|
192
|
+
- **C2PA metadata** is included on Pro/paid outputs (verifiable provenance chain)
|
|
193
|
+
|
|
194
|
+
## Key Limitations
|
|
195
|
+
- No video generation (image only)
|
|
196
|
+
- No transparent backgrounds (PNG but always with background)
|
|
197
|
+
- Text rendering quality varies; keep text under 25 characters for best results
|
|
198
|
+
- Safety filters may block some prompts (violence, NSFW, public figures), known to be overly cautious
|
|
199
|
+
- Session context resets between your AI agent conversations
|
|
200
|
+
- `imageSize` and thinking level depend on MCP package version support
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# MCP Tools Reference: @ycse/nanobanana-mcp
|
|
2
|
+
|
|
3
|
+
> Package: `@ycse/nanobanana-mcp`
|
|
4
|
+
> GitHub: https://github.com/YCSE/nanobanana-mcp
|
|
5
|
+
|
|
6
|
+
## Tools
|
|
7
|
+
|
|
8
|
+
### gemini_generate_image
|
|
9
|
+
Generate an image from a text prompt.
|
|
10
|
+
|
|
11
|
+
**Parameters:**
|
|
12
|
+
| Param | Type | Required | Description |
|
|
13
|
+
|-------|------|----------|-------------|
|
|
14
|
+
| `prompt` | string | Yes | Text description of the image to generate |
|
|
15
|
+
|
|
16
|
+
**Returns:** Image data + file path (saved to `~/Documents/nanobanana_generated/`)
|
|
17
|
+
|
|
18
|
+
**Example usage in your AI agent:**
|
|
19
|
+
```
|
|
20
|
+
User: "Generate a sunset over mountains in watercolor style"
|
|
21
|
+
→ Claude calls gemini_generate_image with prompt
|
|
22
|
+
→ Returns image path and description
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### gemini_edit_image
|
|
26
|
+
Edit an existing image with text instructions.
|
|
27
|
+
|
|
28
|
+
**Parameters:**
|
|
29
|
+
| Param | Type | Required | Description |
|
|
30
|
+
|-------|------|----------|-------------|
|
|
31
|
+
| `imagePath` | string | Yes | Path to the image file to edit |
|
|
32
|
+
| `prompt` | string | Yes | Edit instructions |
|
|
33
|
+
|
|
34
|
+
**Returns:** Modified image data + file path
|
|
35
|
+
|
|
36
|
+
**Example:**
|
|
37
|
+
```
|
|
38
|
+
User: "Remove the background from ~/Documents/photo.png"
|
|
39
|
+
→ Claude calls gemini_edit_image with path and instruction
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### gemini_chat
|
|
43
|
+
Multi-turn visual conversation maintaining session context.
|
|
44
|
+
|
|
45
|
+
**Parameters:**
|
|
46
|
+
| Param | Type | Required | Description |
|
|
47
|
+
|-------|------|----------|-------------|
|
|
48
|
+
| `message` | string | Yes | Chat message (can reference previous images) |
|
|
49
|
+
|
|
50
|
+
**Returns:** Text response + optional image
|
|
51
|
+
|
|
52
|
+
**Key feature:** Session consistency, which maintains style, characters, and context across turns. Great for iterative refinement.
|
|
53
|
+
|
|
54
|
+
### set_aspect_ratio
|
|
55
|
+
Configure the aspect ratio for subsequent image generations.
|
|
56
|
+
|
|
57
|
+
**Parameters:**
|
|
58
|
+
| Param | Type | Required | Description |
|
|
59
|
+
|-------|------|----------|-------------|
|
|
60
|
+
| `ratio` | string | Yes | Aspect ratio (e.g., "16:9", "1:1", "9:16") |
|
|
61
|
+
|
|
62
|
+
**Supported ratios:** 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, 5:4, 1:4, 4:1, 1:8, 8:1, 21:9
|
|
63
|
+
|
|
64
|
+
### set_model
|
|
65
|
+
Switch the active Gemini model.
|
|
66
|
+
|
|
67
|
+
**Parameters:**
|
|
68
|
+
| Param | Type | Required | Description |
|
|
69
|
+
|-------|------|----------|-------------|
|
|
70
|
+
| `model` | string | Yes | Model identifier |
|
|
71
|
+
|
|
72
|
+
**Available models:**
|
|
73
|
+
- `gemini-3.1-flash-image-preview` (default, recommended)
|
|
74
|
+
- `gemini-2.5-flash-image` (stable fallback)
|
|
75
|
+
|
|
76
|
+
### get_image_history
|
|
77
|
+
Retrieve list of images generated in the current session.
|
|
78
|
+
|
|
79
|
+
**Parameters:** None
|
|
80
|
+
|
|
81
|
+
**Returns:** Array of image entries with paths and prompts
|
|
82
|
+
|
|
83
|
+
### clear_conversation
|
|
84
|
+
Reset session context and conversation history.
|
|
85
|
+
|
|
86
|
+
**Parameters:** None
|
|
87
|
+
|
|
88
|
+
**Returns:** Confirmation of reset
|
|
89
|
+
|
|
90
|
+
## Environment Variables
|
|
91
|
+
|
|
92
|
+
| Variable | Required | Description |
|
|
93
|
+
|----------|----------|-------------|
|
|
94
|
+
| `GOOGLE_AI_API_KEY` | Yes | API key from https://aistudio.google.com/apikey |
|
|
95
|
+
| `NANOBANANA_MODEL` | No | Override default model (default: `gemini-3.1-flash-image-preview`) |
|
|
96
|
+
|
|
97
|
+
## Output Directory
|
|
98
|
+
All generated images are saved to: `~/Documents/nanobanana_generated/`
|
|
99
|
+
|
|
100
|
+
Images are named with timestamps for easy identification.
|
|
101
|
+
|
|
102
|
+
## Feature Availability via MCP
|
|
103
|
+
|
|
104
|
+
Some newer Gemini API features depend on the MCP package version of `@ycse/nanobanana-mcp`. Check the package version to confirm support:
|
|
105
|
+
|
|
106
|
+
| Feature | API Status | MCP Support |
|
|
107
|
+
|---------|-----------|-------------|
|
|
108
|
+
| `imageSize` (resolution control) | Available | Depends on package version |
|
|
109
|
+
| Thinking level (`thinkingConfig`) | Available | Depends on package version |
|
|
110
|
+
| Search grounding (`googleSearch`) | Available | Depends on package version |
|
|
111
|
+
| Image-only output (`responseModalities: ["IMAGE"]`) | Available | Depends on package version |
|
|
112
|
+
| Multi-image input (up to 14 refs) | Available | Via `gemini_chat` with image paths |
|
|
113
|
+
| All 14 aspect ratios | Available | Via `set_aspect_ratio` |
|
|
114
|
+
|
|
115
|
+
If a feature is not yet supported by the MCP package, you can still use it via direct API calls with `curl` or the Google AI SDK.
|