Skip to content
Skillpedia
Images & icons48k Β· #3615

image-generation

What it does

It teaches your agent to create and edit pictures with AI image models, choosing an available provider automatically. It is for anyone who needs a visual made from a written description.

When to use it

  • βœ“When you ask for an illustration, icon, poster, or photo to be created.
  • βœ“When you want an existing image edited, such as changing its style or colors.
  • βœ“When you need a visual made and do not care which AI model makes it.

Skill link

https://github.com/zhayujie/CowAgent/blob/master/skills/image-generation/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/zhayujie/CowAgent/blob/master/skills/image-generation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCan you create a poster for my bakery opening with a cheerful, warm style?”

5 new skills a week. 1 minute to read.

How it works

The agent picks an available image model based on the keys that are set, writes the request, and saves the images in your workspace. Generation can take a minute or more.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Image Generation

Generate and edit images using AI models. The script automatically picks a backend based on which API keys are configured β€” you don't need to specify a model unless the user explicitly names one. Never guess or invent a model: when the user doesn't name one, omit model entirely so the configured default/provider is used.

Supported models (passed via model only when the user asks for a specific one):

  • OpenAI β€” gpt-image-2.5-flare (recommended default: best quality/latency trade-off), gpt-image-2.5-sunburst (highest editing precision), gpt-image-2, gpt-image-1
  • Gemini Nano Banana β€” nano-banana-2, nano-banana-pro, nano-banana
  • Seedream (Volcengine Ark) β€” seedream-5.0-lite, seedream-4.5
  • Qwen (DashScope) β€” qwen-image-2.0, qwen-image-2.0-pro
  • MiniMax β€” image-01

Usage

Run scripts/generate.py with a JSON argument. Use the absolute <base_dir> path β€” do NOT cd into the skill directory, since it is a builtin skill and gets reset on restart (anything written there is lost).

python <base_dir>/scripts/generate.py '<json_args>'

Images are saved to the workspace (or the open project dir) under images/, so they persist and stay reachable to the client.

Set bash timeout to at least 600 seconds, as image generation can take 30–200s per provider, and the script may try multiple providers sequentially. Call it synchronously (do not run it in the background) and wait for its output in the same turn.

Parameters

Parameter Type Required Default Description
prompt string yes β€” Image description
image_url string / list no null Input image(s) for editing: local file path or URL. Multi-image fusion is supported (pass a list)
quality string no auto low / medium / high (only some backends honour this)
size string no auto 512 / 1K / 2K / 3K / 4K, or pixel value (1024x1024)
aspect_ratio string no null 1:1 / 3:2 / 2:3 / 16:9 / 9:16 / 21:9 (some backends also support extreme ratios like 1:4 / 8:1)

Higher quality and larger size cost more and run slower. In normal cases, when the user does not explicitly specify, low or medium is sufficient. Only use high when the user asks for it.

Example β€” generate

python <base_dir>/scripts/generate.py '{"prompt": "A corgi astronaut floating in space"}'

With aspect ratio:

python <base_dir>/scripts/generate.py '{"prompt": "Isometric miniature city of Shanghai at sunset", "size": "2K", "aspect_ratio": "16:9"}'

Important: Editing vs Generating

When the user asks to edit, modify, or improve an existing image, pass the original image via image_url. Prefer local file paths directly β€” the script handles file reading internally. Without image_url, the script generates a brand-new image instead of editing.

Example β€” edit (image-to-image)

python <base_dir>/scripts/generate.py '{"prompt": "Add a Santa hat to the dog", "image_url": "/path/to/dog.png"}'

Multi-image fusion β€” pass a list:

python <base_dir>/scripts/generate.py '{"prompt": "Combine these characters into a group photo", "image_url": ["/path/a.png", "/path/b.png"]}'

Output

Prints JSON to stdout:

{
  "model": "doubao-seedream-5-0-260128",
  "images": [
    {"url": "/path/to/output.png"}
  ]
}

After success, display the image to the user. You can either embed it in markdown (![description](/path/to/output.png)) or use the send tool.

On error:

{
  "error": "error message"
}

Setup

The script needs at least one of these API keys (set via env_config or config.json):

OPENAI_API_KEY / GEMINI_API_KEY / ARK_API_KEY / DASHSCOPE_API_KEY / MINIMAX_API_KEY / LINKAI_API_KEY

Each also has an optional *_API_BASE for custom endpoints. The script automatically picks the first configured backend and falls back to the next if it fails β€” no need to specify a model.

Error Handling

If the script returns an error after trying all configured backends, do NOT retry with the same parameters β€” the failure is almost always a configuration issue (wrong API key, unsupported API base). Tell the user to fix it via env_config, then retry.

Notes

  • HTTP timeout is 300s β€” high-resolution generation can take over 200s.
  • Omit quality /
FAQ

Do I need to choose a model?

No. If you do not name one, the skill uses the configured default provider.

Where are the images saved?

They are saved in the images folder in your workspace, so you can find them later.

How long does it take?

The skill says generation can take 30 to 200 seconds per provider.

Details

Original description by the author

Generate or edit images from text prompts. Use when the user asks to create, draw, design, or edit an image, illustration, photo, icon, poster, or any visual content.

repo: zhayujie/CowAgent

Popularity

GitHub stars
48k
Ranking position
#3615
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills