generate-image

Generate and edit images using OpenRouter AI models like FLUX and Gemini.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/svpfahad/RES200 --skill generate-image-svpfahad
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-image
Source: https://github.com/svpfahad/RES200/tree/main/claude-scientific-writer-main/.claude/skills/generate-image
Command: npx skills add https://github.com/svpfahad/RES200 --skill generate-image-svpfahad

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) components.

What problem does it solve? Creating custom visual assets such as illustrations, concept art, and presentation images normally requires design tools or stock photo searches. This Skill generates and edits images directly from text prompts through OpenRouter's image generation models. ## Core Features & Use Cases - Text-to-Image Generation: Create photos, illustrations, artwork, and visual assets from natural language prompts using Gemini 3 Pro or FLUX.2 models. - Image Editing: Modify existing images (PNG, JPEG, GIF, WebP) with editing instructions, such as changing backgrounds or removing elements. - Use Case: While writing a scientific paper, generate a conceptual illustration of immunotherapy attacking cancer cells and save it directly to your figures folder for inclusion in the manuscript. ## Quick Start Ask the AI to generate an image of your described subject and save it to a specified output path using the generate_image.py script.

Frequently Asked Questions about generate-image

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with OpenRouter in Python?

Run the generate_image.py script with a text prompt, for example: python scripts/generate_image.py "A sunset over mountains". The script calls the OpenRouter chat completions API and saves the result as a PNG file.

How do I edit an existing image with AI?

Pass the input image path with the --input flag along with editing instructions, such as python scripts/generate_image.py "Make the sky purple" --input photo.jpg. Both Gemini 3 Pro and FLUX.2 Pro support image editing through OpenRouter.

Which OpenRouter image model should I use, Gemini or FLUX?

Use google/gemini-3-pro-image-preview (the default) or black-forest-labs/flux.2-pro for high-quality generation and editing. Use black-forest-labs/flux.2-flex for cheaper, faster generation only, since it does not support editing.

Why does the script say OPENROUTER_API_KEY not found?

The script requires an OpenRouter API key from https://openrouter.ai/keys. Add OPENROUTER_API_KEY=your-key to a .env file in your project directory, set it as an environment variable, or pass it with the --api-key flag.

What image formats are supported for editing input?

The script accepts PNG, JPEG, GIF, and WebP files as editing inputs. Input images are base64-encoded and sent to the model, and output is always saved as a PNG file.

When should I use scientific-schematics instead of image generation?

Use scientific-schematics for technical diagrams such as flowcharts, circuit diagrams, biological pathways, and CONSORT diagrams. Use generate-image for photos, illustrations, artwork, and general visual assets.