generate-image

Use when the user needs to generate images, UI assets, icons, backgrounds, placeholders, or any visual content. Triggers on requests like "generate an image", "create a picture", "make an icon", "I need a visual for...".

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "generate-image" with this command: npx skills add wxul/openrouter-generate-image-skill/wxul-openrouter-generate-image-skill-generate-image

Generate Image via OpenRouter

Generate images using OpenRouter's image models from the command line. Default model: google/gemini-3.1-flash-image-preview.

Prerequisites

  • OPENROUTER_API_KEY environment variable must be set
  • tsx available via npx

Usage

Run the script via npx tsx:

npx tsx generate-image.ts \
  --prompt "description of the image" \
  --model "google/gemini-3.1-flash-image-preview" \
  --width 1024 --height 1024 \
  --output "filename.png" \
  --dir "./generated-images" \
  --proxy "http://127.0.0.1:7890"

Parameters

ParamRequiredDefaultDescription
--promptYes-Image description
--modelNogoogle/gemini-3.1-flash-image-previewOpenRouter model ID
--widthNo1024Image width
--heightNo1024Image height
--outputNoauto (timestamp-slug.png)Output filename
--dirNo./generated-imagesOutput directory
--proxyNo-HTTP proxy URL

Supported Models

  • google/gemini-3.1-flash-image-preview (default, recommended)
  • black-forest-labs/flux-1.1-pro
  • black-forest-labs/flux-schnell
  • Any OpenRouter model that supports image generation

How to Use as an Agent

When the user asks you to generate an image:

  1. Compose a detailed English prompt describing the desired image
  2. Choose appropriate model and size for the use case
  3. Run the script using Bash tool
  4. The script outputs the saved file path to stdout — use this path to reference the image in code or tell the user

Quick Examples

# Simple generation with defaults
npx tsx generate-image.ts \
  --prompt "a minimalist logo of a mountain with a sun, flat design, blue and orange"

# With specific model and output
npx tsx generate-image.ts \
  --prompt "abstract gradient background, purple to blue" \
  --model "black-forest-labs/flux-1.1-pro" \
  --output "bg-gradient.png" \
  --dir "./public/images"

# With proxy
npx tsx generate-image.ts \
  --prompt "pixel art cat sitting on a desk" \
  --proxy "http://127.0.0.1:7890"

Troubleshooting

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

generate-image

No summary provided by upstream source.

Repository SourceNeeds Review
General

generate-image

No summary provided by upstream source.

Repository SourceNeeds Review
General

generate-image

No summary provided by upstream source.

Repository SourceNeeds Review
General

generate-image

No summary provided by upstream source.

Repository SourceNeeds Review