Gemini Image Simple

Generate and edit images with Gemini API using pure Python stdlib. Zero dependencies - works on locked-down environments where pip/uv aren't available.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
2 · 5.5k · 35 current installs · 36 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Skill name/description (generate/edit images with Gemini) match the included script and required environment variable. The script calls Google's generativelanguage API, uses only GEMINI_API_KEY, and reads/writes image files as expected.
Instruction Scope
SKILL.md instructs the agent to set GEMINI_API_KEY and run the provided Python script. The runtime instructions and script only read local image files (when editing), access the declared environment variable, and send/receive image data to the Google API endpoint. There is no code or instruction to read unrelated system files, other environment variables, or send data to unexpected endpoints.
Install Mechanism
No install spec is provided (instruction-only plus one script). This minimizes disk-writing/install risk. The script uses only Python stdlib; no external downloads or package installs are present.
Credentials
Only GEMINI_API_KEY is required, which is proportional to the skill's need to authenticate to the Gemini/Generative Language API. No unrelated credentials or config paths are requested.
Persistence & Privilege
The skill does not request always: true, does not modify other skills, and has no installation hooks or persistent privileges. It runs only when invoked.
Assessment
This skill appears to do what it claims, but exercise normal caution before installing code from an unknown source: (1) Review the script (already included) and confirm you trust the publisher; (2) Store your GEMINI_API_KEY securely — the script places the key in the request URL as a query parameter, which can be logged by intermediaries (consider using a more secure header-based auth if you control the environment); (3) Be aware model names are preview/beta and usage will consume your API quota and may be billed; (4) Avoid sending sensitive images to third-party APIs; (5) If you need stricter assurance, run the script in an isolated environment or container and/or replace the URL/auth handling with your organization’s approved client/secret management. Overall the package is coherent and low risk given the included source matches the documentation.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.1.0
Download zip
latestvk977whm8t26nh05rdkzrbksnts80ag2n

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

🎨 Clawdis
EnvGEMINI_API_KEY

SKILL.md

Gemini Image Simple

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) - the highest quality image generation model.

Why This Skill

FeatureThis SkillOthers (nano-banana-pro, etc.)
DependenciesNone (stdlib only)google-genai, pillow, etc.
Requires pip/uv❌ No✅ Yes
Works on Fly.io free✅ Yes❌ Fails
Works in containers✅ Yes❌ Often fails
Image generation✅ Full✅ Full
Image editing✅ Yes✅ Yes
Setup complexityJust set API keyInstall packages first

Bottom line: This skill works anywhere Python 3 exists. No package managers, no virtual environments, no permission issues.

Quick Start

# Generate
python3 /data/clawd/skills/gemini-image-simple/scripts/generate.py "A cat wearing a tiny hat" cat.png

# Edit existing image  
python3 /data/clawd/skills/gemini-image-simple/scripts/generate.py "Make it sunset lighting" edited.png --input original.png

Usage

Generate new image

python3 {baseDir}/scripts/generate.py "your prompt" output.png

Edit existing image

python3 {baseDir}/scripts/generate.py "edit instructions" output.png --input source.png

Supported input formats: PNG, JPG, JPEG, GIF, WEBP

Environment

Set GEMINI_API_KEY environment variable. Get one at https://aistudio.google.com/apikey

How It Works

Uses Nano Banana Pro (nano-banana-pro-preview) - Google's highest quality image generation model:

  • Pure urllib.request for HTTP (no requests library)
  • Pure json for parsing (stdlib)
  • Pure base64 for encoding (stdlib)

That's it. No external packages. Works on any Python 3.10+ installation.

Model

Currently using: nano-banana-pro-preview (also known as Gemini 3 Pro Image)

Other available models (can be changed in generate.py if needed):

  • gemini-3-pro-image-preview - Same as Nano Banana Pro
  • imagen-4.0-ultra-generate-001 - Imagen 4.0 Ultra
  • imagen-4.0-generate-001 - Imagen 4.0
  • gemini-2.5-flash-image - Gemini 2.5 Flash with image gen

Examples

# Landscape
python3 {baseDir}/scripts/generate.py "Misty mountains at sunrise, photorealistic" mountains.png

# Product shot
python3 {baseDir}/scripts/generate.py "Minimalist product photo of a coffee cup, white background" coffee.png

# Edit: change style
python3 {baseDir}/scripts/generate.py "Convert to watercolor painting style" watercolor.png --input photo.jpg

# Edit: add element
python3 {baseDir}/scripts/generate.py "Add a rainbow in the sky" rainbow.png --input landscape.png

Files

2 total
Select a file
Select a file to preview.

Comments

Loading comments…