Generate or edit images using AI models (FLUX, Gemini). Use for general-purpose image generation including photos, illustrations, artwork, visual assets, concept art, and any image that isn't a technical diagram or schematic. For flowcharts, circuits, pathways, and technical diagrams, use the scientific-schematics skill instead.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
High
Do not use without reviewing
Generate and edit high-quality images using OpenRouter's image generation models including FLUX.2 Pro and Gemini 3 Pro.
Use generate-image for:
Use scientific-schematics instead for:
Use the scripts/generate_image.py script to generate or edit images:
# Generate a new image
python scripts/generate_image.py "A beautiful sunset over mountains"
# Edit an existing image
python scripts/generate_image.py "Make the sky purple" --input photo.jpgThis generates/edits an image and saves it as generated_image.png in the current directory.
CRITICAL: The script requires an OpenRouter API key. It resolves the key in
this order: --api-key flag → OPENROUTER_API_KEY environment variable →
.env file. If the user connected an OpenRouter key (openscience login or the
dashboard), it is already exported into the environment and the script will pick
it up automatically. If the user pastes their own key in chat, pass it inline:
OPENROUTER_API_KEY="<key>" python scripts/generate_image.py "...".
If no key is found, inform the user they can:
openscience login or at https://app.syntheticsciences.ai → Servicesexport OPENROUTER_API_KEY=your-api-key-hereDefault model: google/gemini-3-pro-image (Nano Banana Pro, GA — high quality, recommended)
Available models for generation and editing:
google/gemini-3-pro-image - Nano Banana Pro (GA), supports generation + editinggoogle/gemini-3-pro-image-preview - Preview slug (retires 2026-06-25); use the GA slug aboveblack-forest-labs/flux.2-pro - Fast, high quality, supports generation + editingGeneration only:
black-forest-labs/flux.2-flex - Fast and cheap, but not as high quality as proSelect based on:
python scripts/generate_image.py "Your prompt here"python scripts/generate_image.py "A cat in space" --model "black-forest-labs/flux.2-pro"python scripts/generate_image.py "Abstract art" --output artwork.pngpython scripts/generate_image.py "Make the background blue" --input photo.jpgpython scripts/generate_image.py "Add sunglasses to the person" --input portrait.png --model "black-forest-labs/flux.2-pro"python scripts/generate_image.py "Remove the text from the image" --input screenshot.png --output cleaned.pngRun the script multiple times with different prompts or output paths:
python scripts/generate_image.py "Image 1 description" --output image1.png
python scripts/generate_image.py "Image 2 description" --output image2.pngprompt (required): Text description of the image to generate, or editing instructions--input or -i: Input image path for editing (enables edit mode)--model or -m: OpenRouter model ID (default: google/gemini-3-pro-image)--output or -o: Output file path (default: generated_image.png)--api-key: OpenRouter API key (overrides .env file)# Generate a conceptual illustration for a paper
python scripts/generate_image.py "Microscopic view of cancer cells being attacked by immunotherapy agents, scientific illustration style" --output figures/immunotherapy_concept.png
# Create a visual for a presentation
python scripts/generate_image.py "DNA double helix structure with highlighted mutation site, modern scientific visualization" --output slides/dna_mutation.png# Title slide background
python scripts/generate_image.py "Abstract blue and white background with subtle molecular patterns, professional presentation style" --output slides/background.png
# Poster hero image
python scripts/generate_image.py "Laboratory setting with modern equipment, photorealistic, well-lit" --output poster/hero.png# Website or documentation images
python scripts/generate_image.py "Professional team collaboration around a digital whiteboard, modern office" --output docs/team_collaboration.png
# Marketing materials
python scripts/generate_image.py "Futuristic AI brain concept with glowing neural networks" --output marketing/ai_concept.pngThe script provides clear error messages for:
If the script fails, read the error message and address the issue before retrying.
images and content response formats from different OpenRouter models52845c3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.