Guide · Agent skill
How to use the Image Generation agent skill (CowAgent)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The image-generation skill lets an AI agent create new pictures from a written description and edit images you provide. It is part of the CowAgent skills collection, and it works by calling an image service you already have an API key for. This guide explains what the skill does, how to install it, how to trigger it with normal requests, and what to check for cost, privacy and safety before you rely on it.
Quick start
- 1Download the ZIP. Download the image-generation skill ZIP from this page.
- 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project.
- 3Or upload it in the Claude apps. In the Claude apps, open Settings → Capabilities → Skills and upload the ZIP.
- 4Add an API key. Set at least one of OPENAI_API_KEY, GEMINI_API_KEY, ARK_API_KEY, DASHSCOPE_API_KEY, MINIMAX_API_KEY or LINKAI_API_KEY through env_config or config.json.
- 5Make a request. Ask the agent in plain language to create or edit an image, and include the subject, style and any size or aspect ratio you need.
- 6Check the output. The script saves the image under images/ and the agent displays it. Ask for a change if needed.
What the image-generation skill makes the agent do
Once installed, the agent can create images from a text prompt, such as illustrations, icons, posters, photos or other visual content. It can also edit an existing image you supply, for example by adding an object to a picture or combining several pictures into one.
The skill runs a bundled Python script, scripts/generate.py. The script sends your request to whichever image service is configured: OpenAI, Google Gemini, Volcengine Seedream, Alibaba Qwen (DashScope), MiniMax or LinkAI. It then saves the result as a file under images/ in your workspace or project folder, and the agent shows it to you.
Install the image-generation skill
Option 1: download the skill ZIP from this page and unzip it into your personal skills folder, ~/.claude/skills/, or into a project's .claude/skills/ folder if you want it only for that project.
Option 2: in the Claude apps, open Settings, go to Capabilities, then Skills, and upload the ZIP.
Whichever route you take, the skill folder must contain SKILL.md and scripts/generate.py.
- Personal: ~/.claude/skills/
- Project only: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills
Set up an API key and Python
The script needs Python with the requests library. If requests is missing, it falls back to the standard library. It also needs at least one API key for a supported service. The script picks the first configured backend and moves to the next one if it fails, so you do not have to choose a model.
Keys are set through env_config or config.json. Each service also has an optional *_API_BASE setting for a custom endpoint.
- OPENAI_API_KEY
- GEMINI_API_KEY
- ARK_API_KEY (Seedream)
- DASHSCOPE_API_KEY (Qwen)
- MINIMAX_API_KEY
- LINKAI_API_KEY
Trigger the skill with natural requests
You do not need special syntax. The skill is meant to be used when you ask the agent to create, draw, design or edit an image, illustration, photo, icon, poster or other visual. Describe what you want and, for edits, attach or point to the original image.
Be specific about subject, style, composition and aspect ratio. Only name a specific model if you want one; otherwise the configured default is used.
- Draw a watercolor fox reading a book, square format.
- Design a poster for a jazz night, 16:9.
- Add a Santa hat to the dog in this photo.
- Combine these two characters into a group photo.
Examples: generating and editing from the script
The agent runs the script for you, but you can see the exact calls it makes. A basic generation needs only a prompt. Adding size and aspect_ratio changes the output dimensions. For editing, pass the original file path in image_url. Without image_url, the script creates a new image instead of editing yours.
Multi-image fusion takes a list of paths in image_url.
python <base_dir>/scripts/generate.py '{"prompt": "A corgi astronaut floating in space"}'
python <base_dir>/scripts/generate.py '{"prompt": "Add a Santa hat to the dog", "image_url": "/path/to/dog.png"}'Settings that control quality, size and cost
Quality accepts low, medium or high, and only some backends honour it. Size accepts 512, 1K, 2K, 3K, 4K or a pixel value such as 1024x1024. Aspect ratio accepts values such as 1:1, 3:2, 2:3, 16:9, 9:16 and 21:9.
Higher quality and larger sizes cost more and take longer. If you do not specify, low or medium is usually enough, and the defaults are auto.
- Use high only when you ask for it.
- Generation can take 30 to 200 seconds per provider, and the script can try several providers in turn.
Safety, privacy and troubleshooting
The skill runs a script and uses the network. Edited images are uploaded to the provider you have chosen, so do not send sensitive photos unless you accept that. Each generation is billed by the provider you configured.
If the script fails after trying every configured backend, the usual cause is a configuration problem such as a wrong API key or an unsupported API base. The skill's own guidance is not to retry with the same parameters. Check the key or endpoint, then try again.
- Set bash timeout to at least 600 seconds if you run the script yourself.
- HTTP timeout inside the script is 300 seconds.
- Input images are auto-compressed to 4MB or less, with the longest edge at 4096px or less.
What people use it for
- Illustrations for blog posts or slides
- Icon drafts for an app or website
- Poster and social post mockups
- Adding or removing an object from an existing photo
- Combining several images into one group picture
Frequently asked questions
How do I install the image generation skill?
Download the skill ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.
Is the image generation skill free?
The skill itself is MIT licensed. Each image is billed by the provider whose API key you configure, so costs apply per generation. Higher quality and larger sizes cost more.
What do I need to run the image generation skill?
You need Python with the requests library (the script falls back to the standard library if it is missing) and at least one API key for OpenAI, Gemini, Seedream, Qwen, MiniMax or LinkAI. Custom *_API_BASE endpoints are optional.
Which AI image services does it support?
It supports OpenAI, Google Gemini (Nano Banana models), Volcengine Seedream, Alibaba Qwen via DashScope, MiniMax and LinkAI. The script uses the first configured service and falls back to the next if one fails.
Can it edit my own photos?
Yes. Pass the file path in image_url and the script edits that image, and it can also combine several images. Edited images are uploaded to the third-party provider you chose, so avoid sensitive photos unless that is acceptable.
Why does the skill fail with an error?
The most common cause is a wrong API key or an unsupported API base after every configured backend has been tried. Fix the key or endpoint in env_config or config.json, then run the request again.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits people who want quick illustrations, icons or draft visuals inside an agent workflow and already have an API key for a supported image service. It is a poor fit if you have no key, need exact brand assets or pixel-level control, or must keep photos off third-party servers. For those cases, a traditional design tool or a stricter workflow is the better choice.
Download the skill