nano-banana-pro-json
Skill7 starsChanged 4 months agoMITView on GitHub
Generate and edit raster images with Google's Nano Banana Pro (Gemini 3 Pro Image): create an image, or change an existing one ("change the background", "replace X with Y"). Covers logos and brand marks, product and marketing shots, hero images, ad creative, packaging mockups and illustrated infographics, with style presets, aspect ratios and WebP output. The default skill for generating or editing an image.
- Reads credentials
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beadsSkill
- azadvertizerSkill
- business-planSkill
- c7searchSkill
- clear-and-humanSkill
- convert-to-webpSkill
- cv-and-humanSkill
- cv-cover-letterSkill
- cv-evidence-baseSkill
- dev-fleetSkill
- excalidraw-diagramSkill
- frontier-roundsSkill
- ghost-publishSkill
- hook-and-humanSkill
- interview-panelSkill
- job-feedsSkill
- markdown-converterSkill
- readabilitySkill
- report-builderSkill
- social-image-prepSkill
- source-snapshotSkill
- terraform-registrySkill
- terragrunt-skillSkill
- transcribe-summarizeSkill
- travel-planningSkill
- trilium-captureSkill
- use-linearisSkill
- ux-auditSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Run the script using absolute path (do NOT cd to skill directory first):
- Distinctive: line 20
Important: Always run from the user's current working directory so images save where the user is working.
- Very specific: line 41
Use --style-preset NAME to apply a curated camera/lighting/composition profile:
- Very specific: line 62
When the user wants a logo, brand mark, wordmark, or brand identity, follow the brand-brief recipe in references/logo-brand-identity.md: …
- Very specific: line 101
Use --json-config with a file path or inline JSON string:
- Distinctive: line 151
All fields are optional. Only include what you want to control.
- Very specific: line 155
Use --aspect-ratio to guide composition (applied as prompt text, not API parameter):
- Very specific: line 170
Use --photorealistic to auto-inject quality markers (8k, ultra-sharp, hyperrealistic, visible pores, natural skin texture, etc.):
- Distinctive: line 181
All options can be combined.
- Very specific: line 209
No mention of resolution -> 1K
- Distinctive: line 234
When modifying an existing image:
- Very specific: line 235
Use --input-image with the path to the source image
- Very specific: line 237
All style/preset/photorealistic options work with editing too
- Very specific: line 259
Use --webp to force WebP output regardless of filename extension:
- Very specific: line 272
Use --quality (1-100, default 80) to control JPEG/WebP compression:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nano Banana Pro JSON - Advanced Image Generation
Generate and edit images using Google's Nano Banana Pro API with structured JSON control, style presets, and photorealistic enhancement.
Usage
Run the script using absolute path (do NOT cd to skill directory first):
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py --prompt "description" --filename "output.png" [options]Important: Always run from the user's current working directory so images save where the user is working.
Do not read an image file before editing it. Pass its path to --input-image and let the script send it. Reading it first spends the whole file through the context window and changes nothing about the result.
If uv isn't found (uv: command not found — non-interactive shells often drop ~/.local/bin or the Homebrew bin from PATH), resolve it and call it explicitly rather than giving up. This script needs uv (third-party deps: google-genai, pillow), so plain python3 is not a fallback here:
UV="$(command -v uv || ls "$HOME/.local/bin/uv" "$HOME/.cargo/bin/uv" /opt/homebrew/bin/uv /usr/local/bin/uv 2>/dev/null | head -1)"
"$UV" run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py --prompt "..." --filename "..."Simple Mode
Works identically to the original nano-banana-pro skill:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py --prompt "A serene Japanese garden" --filename "2025-11-23-14-23-05-japanese-garden.png"Style Presets
Use --style-preset NAME to apply a curated camera/lighting/composition profile:
| Preset | Camera | Lighting | Look |
photorealistic-studio | Sony A7III, 85mm f/1.4 | Studio three-point, 5500K | Professional headshot, clean |
nostalgic-film | Film 35mm f/2.8 | Direct flash, warm 3800K | 1990s aesthetic, grain |
cinematic | Kodak Portra 400, 50mm f/1.8 | Golden hour side light, 3200K | Film grain, bokeh, emotional |
high-fashion | DSLR 85mm f/2.0 | Dramatic flash, cool 5000K | Editorial, bold styling |
anime-hyperrealistic | Portrait lens 85mm f/1.4 | Spotlight, cool 6500K | Anime-inspired, high contrast |
Example:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "portrait of a woman in a garden" \
--filename "2025-11-23-14-23-05-studio-portrait.png" \
--style-preset photorealistic-studioLogos & brand identity
Logos are a distinct mode — flat, iconic, scalable, the opposite of the photographic presets above.
When the user wants a logo, brand mark, wordmark, or brand identity, follow the brand-brief
recipe in references/logo-brand-identity.md: take a short
brief (name, industry, personality, colors, logo type, icon concept), construct a logo-appropriate
prompt (flat vector, minimal, strong silhouette, limited palette — explicitly away from
photorealism/3D/gradients), generate a batch of varied concepts at --aspect-ratio 1:1 --resolution 2K
(no photographic --style-preset, no --photorealistic), run the proof checklist (monochrome,
favicon-size, spelling, originality), iterate via --input-image one change at a time, then
vectorize the winner to SVG for free (vtracer/potrace — the step every paid logo tool charges for).
Boundary: the generator makes a raster concept (the recipe's Step 5 traces it to production SVG locally). It does not do trademark clearance or confirm font licensing, and text can slip — verify a wordmark's spelling.
Product & marketing images
For product shots, e-commerce catalog images, lifestyle scenes, and ad creative, follow
references/product-marketing.md. It's photographic (the presets
help), and adds the product-specific discipline: e-commerce specs (pure #FFFFFF bg, product fills
70-90%, per-platform aspect ratios), identity-lock when you pass a real product via
--input-image ("preserve exact appearance; do not reinterpret"), consistent shot sets
(lock lighting/angle, vary one element), and on-image text.
Boundary: for a real product it can subtly alter details — verify the render against reality, and never render fabricated prices/claims/label text or brand-impersonation imagery.
Infographics & explanatory diagrams
For infographics, explainers, and process/comparison diagrams, follow
references/infographics-diagrams.md: pick a layout matching
the content's shape (timeline / pyramid / hub-and-spoke / comparison / funnel / cross-section) and a
named style (corporate-flat, isometric, blueprint…), supply every label and number verbatim in
quotes, and proofread the output.
Boundary: it renders the look of an infographic, not trustworthy data — it garbles text and
invents numbers. Supply the facts and verify them; for real data viz use the report-builder
skill, not this.
JSON Configuration
Use --json-config with a file path or inline JSON string:
# Inline JSON
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "mountain landscape" \
--filename "output.png" \
--json-config '{"style_parameters":{"camera":{"focal_length":"24mm","aperture":"f/8"}}}'
# File path
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "mountain landscape" \
--filename "output.png" \
--json-config config.jsonFull JSON Schema
{
"prompt": "optional - CLI --prompt always takes precedence",
"consistency_id": "character name for consistency across generations",
"style_parameters": {
"camera": {
"type": "DSLR",
"model": "Sony A7III",
"focal_length": "85mm",
"aperture": "f/1.4",
"shutter_speed": "1/200s",
"iso": "100"
},
"lighting": {
"type": "Studio",
"setup": "Three-point lighting",
"direction": "Front-angled key light",
"color_temperature": "5500K"
},
"composition": {
"framing": "Medium close-up",
"perspective": "Eye-level",
"depth_of_field": "Shallow"
}
},
"output_settings": {
"aspect_ratio": "16:9",
"format": "png"
}
}All fields are optional. Only include what you want to control.
Aspect Ratio
Use --aspect-ratio to guide composition (applied as prompt text, not API parameter):
Choices: 1:1, 4:3, 16:9, 9:16, 3:2, 2:3, 4:5, 3:4
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "cityscape at dusk" \
--filename "output.png" \
--aspect-ratio 16:9Can also be set via JSON output_settings.aspect_ratio. CLI flag takes precedence.
Photorealistic Enhancement
Use --photorealistic to auto-inject quality markers (8k, ultra-sharp, hyperrealistic, visible pores, natural skin texture, etc.):
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "portrait of an elderly fisherman" \
--filename "output.png" \
--photorealisticCombining Options
All options can be combined. Precedence rules:
- Prompt: CLI
--promptalways wins over JSONpromptfield - Aspect ratio: CLI
--aspect-ratiowins over JSONoutput_settings.aspect_ratio - Style: Preset provides base defaults, JSON config overrides specific fields via deep merge
- Photorealistic: Additive -- markers are appended regardless of other settings
Example combining everything:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "portrait of a woman on a rooftop at sunset" \
--filename "2025-11-23-14-23-05-rooftop-portrait.png" \
--style-preset cinematic \
--json-config '{"style_parameters":{"camera":{"focal_length":"35mm"}},"consistency_id":"Elena"}' \
--photorealistic \
--aspect-ratio 16:9 \
--resolution 4KResolution
The Gemini 3 Pro Image API supports three resolutions (uppercase K required):
- 1K (default) - ~1024px resolution
- 2K - ~2048px resolution
- 4K - ~4096px resolution
Map user requests:
- No mention of resolution ->
1K - "low resolution", "1080", "1080p", "1K" ->
1K - "2K", "2048", "normal", "medium resolution" ->
2K - "high resolution", "high-res", "hi-res", "4K", "ultra" ->
4K
API Key
Checked in order:
--api-keyargumentGEMINI_API_KEYenvironment variable
Filename Generation
Generate filenames with the pattern: yyyy-mm-dd-hh-mm-ss-name.ext
- Timestamp: Current date/time in
yyyy-mm-dd-hh-mm-ss(24-hour format) - Name: Descriptive lowercase text with hyphens
- Extension:
.png(default),.jpg, or.webpbased on JSON configoutput_settings.format
Examples:
2025-11-23-14-23-05-japanese-garden.png2025-11-23-15-30-12-sunset-mountains.jpg
Image Editing
When modifying an existing image:
- Use
--input-imagewith the path to the source image --promptcontains editing instructions- All style/preset/photorealistic options work with editing too
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "make it look like a cinematic film still" \
--filename "2025-11-23-14-25-30-cinematic-edit.png" \
--input-image "original-photo.jpg" \
--style-preset cinematicOutput Formats
Set via JSON config output_settings.format, filename extension, or --webp flag:
- png (default) - Lossless
- jpg/jpeg - JPEG (lossy, configurable quality)
- webp - WebP (lossy, configurable quality) - converted from Gemini's native PNG/JPEG output via PIL
WebP notes: The Gemini API does not natively export WebP. The script receives the image as PNG/JPEG from the API and converts it to WebP using PIL. This adds a negligible conversion step but produces smaller files with good quality.
WebP convenience flag
Use --webp to force WebP output regardless of filename extension:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "sunset over ocean" \
--filename "2025-11-23-14-23-05-sunset.png" \
--webpThis saves as 2025-11-23-14-23-05-sunset.webp (extension auto-corrected).
Quality control
Use --quality (1-100, default 80) to control JPEG/WebP compression:
# High quality WebP
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "detailed macro photo" \
--filename "output.webp" \
--quality 95
# Smaller file size
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "web thumbnail" \
--filename "output.webp" \
--quality 60Quality has no effect on PNG output (always lossless).
Format precedence
--webpflag (highest)- JSON config
output_settings.format - Filename extension
- Default: PNG
Examples
Simple generation:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "A cat wearing a tiny hat" \
--filename "2025-11-23-14-23-05-cat-hat.png"Studio portrait with preset:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "professional headshot of a young CEO" \
--filename "2025-11-23-14-23-05-ceo-headshot.png" \
--style-preset photorealistic-studio \
--photorealistic \
--resolution 4KCinematic landscape with custom JSON:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "misty mountain valley at dawn" \
--filename "2025-11-23-14-23-05-mountain-dawn.png" \
--json-config '{"style_parameters":{"camera":{"focal_length":"24mm","aperture":"f/11"},"lighting":{"setup":"Soft diffused dawn light","color_temperature":"4000K warm"}}}' \
--aspect-ratio 16:9 \
--resolution 4KNostalgic film edit:
uv run ~/.claude/skills/nano-banana-pro-json/scripts/generate_image.py \
--prompt "add warm film grain and a slight vignette" \
--filename "2025-11-23-14-23-05-nostalgic-edit.png" \
--input-image "modern-photo.jpg" \
--style-preset nostalgic-filmProvenance
This skill calls Google's Gemini image API ("Nano Banana Pro" / Gemini 3 Pro Image) via the official google-genai SDK, and converts output formats with Pillow (PIL). It requires your own GEMINI_API_KEY — no key is bundled or stored in the skill. Not affiliated with or endorsed by Google; Google's API terms, pricing, and content policies apply.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

