alterlab-generate-image — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited alterlab-generate-image (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Generate and edit high-quality images using OpenRouter's image generation models including FLUX.2 Pro and Gemini 3.1 Flash Image Preview (a.k.a. "Nano Banana 2").
Use this skill (`alterlab-generate-image`) for:
Use a different skill instead for:
alterlab-scientific-schematicsalterlab-matplotlib / alterlab-plotly / alterlab-seabornUse 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. Before running, check if the user has configured their API key:
.env file in the project directory or parent directoriesOPENROUTER_API_KEY=<key> in the .env file.env file with OPENROUTER_API_KEY=your-api-key-hereexport OPENROUTER_API_KEY=your-api-key-hereThe script will automatically detect the .env file and provide clear error messages if the API key is missing.
This skill sends your prompts and any input image to a third-party API (OpenRouter) for processing. Avoid sending confidential, clinical, or unpublished material. The OpenRouter API key is read from the environment (OPENROUTER_API_KEY).
Default: google/gemini-3.1-flash-image-preview ("Nano Banana 2") — high quality, generation + editing. Use this unless there's a reason not to.
Other models (all support both generation and editing on OpenRouter):
black-forest-labs/flux.2-pro — frontier visual quality, strong prompt adherence, up to 4 MP.black-forest-labs/flux.2-flex — cheaper; especially good at rendering text/typography and fine detail.Model IDs are version-sensitive — confirm against https://openrouter.ai/models if a call returns a "model not found" error.
# Generate (default model) to a chosen path
python scripts/generate_image.py "Abstract art" --output artwork.png
# Generate with a specific model
python scripts/generate_image.py "A cat in space" --model "black-forest-labs/flux.2-pro"
# Edit an existing image (edit mode is triggered by --input)
python scripts/generate_image.py "Add sunglasses to the person" --input portrait.png --output cleaned.pngFor multiple images, run the script once per prompt with distinct --output paths (it always writes one file and overwrites the default generated_image.png).
prompt (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.1-flash-image-preview)--output or -o: Output file path (default: generated_image.png)--api-key: OpenRouter API key (overrides .env file)# Conceptual figure for a paper (illustration, not a data plot)
python scripts/generate_image.py "Microscopic view of cancer cells being attacked by immunotherapy agents, clean scientific illustration style" --output figures/immunotherapy_concept.png
# Slide background / poster hero image
python scripts/generate_image.py "Abstract blue and white background with subtle molecular patterns, professional presentation style" --output slides/background.png
python scripts/generate_image.py "Modern, well-lit laboratory with current equipment, photorealistic" --output poster/hero.png--output; the script handles both the images and content response shapes used by different OpenRouter models.requests, an API error (with status code), or an unexpected response shape — read it and fix before retrying.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.