Agent skill

AI Image Generation and Editing

by zhayujie in zhayujie/CowAgent

Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

MITAuto-check passedMedia & Creative

Install AI Image Generation and Editing

skills CLI
$ npx skills add zhayujie/CowAgent --skill image-generation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zhayujie/CowAgent image-generation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zhayujie/CowAgent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/image-generation .claude/skills/image-generation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
image-generation
GitHub stars
47k
Token cost
~1.3k tokens
SKILL.md length
525 words
Files
2 (incl. scripts)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

  • Creating an illustration, icon, poster or photo from a text description
  • Runs Python scripts from its folder; calls python; needs OPENAI_API_KEY and GEMINI_API_KEY
  • Editing an existing image given as a file path or URL
  • Combining several input images into one result

What it does

The agent runs scripts/generate.py with a JSON argument holding the prompt and optional settings. The script chooses a backend on its own according to which API keys are configured, so the agent should not name a model unless you ask for one and must never invent a model name. Supported model families include OpenAI image models, Gemini Nano Banana, Seedream, Qwen and MiniMax.

Parameters are the prompt, one or more input images for editing (a list enables multi-image fusion), quality of low, medium or high, a size, and an aspect ratio. Higher quality and larger sizes cost more and run slower, so low or medium is the normal choice and high is reserved for when you ask. Results are saved to an images folder in the workspace or open project so they persist. Generation can take 30 to 200 seconds per provider, so the shell timeout should be at least 600 seconds and the script should run synchronously. The skill also says to call it by absolute path instead of changing into its folder, since a built-in skill's directory is reset on restart.

When your agent uses it

  • Creating an illustration, icon, poster or photo from a text description
  • Editing an existing image given as a file path or URL
  • Combining several input images into one result
  • Producing a specific aspect ratio such as 16:9 or 9:16

Example prompts

  • “Draw a flat-style icon of a paper plane on a pale blue background.”
  • “Edit photo.jpg so the sky looks like a sunset.”
  • “Generate a 16:9 poster for a jazz night with bold typography, at medium quality.”

Requirements

  • Python
  • An API key for at least one supported image provider

What it can do on your machine

Read from SKILL.md and the folder at commit 0152064. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • OPENAI_API_KEY
    • GEMINI_API_KEY
    • ARK_API_KEY
    • DASHSCOPE_API_KEY
    • MINIMAX_API_KEY
    • LINKAI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

AI Image Generation and Editing loads about 1.3k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 525 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from zhayujie/CowAgent at commit 0152064, republished under its MIT licence (© zhayujie). 525 words, ~1,262 tokens.

Download SKILL.mdSave it as .claude/skills/image-generation/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
image-generation
description
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.

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).

bash
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
ParameterTypeRequiredDefaultDescription
promptstringyes—Image description
image_urlstring / listnonullInput image(s) for editing: local file path or URL. Multi-image fusion is supported (pass a list)
qualitystringnoautolow / medium / high (only some backends honour this)
sizestringnoauto512 / 1K / 2K / 3K / 4K, or pixel value (1024x1024)
aspect_ratiostringnonull1: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
bash
python <base_dir>/scripts/generate.py '{"prompt": "A corgi astronaut floating in space"}'

With aspect ratio:

bash
python <base_dir>/scripts/generate.py '{"prompt": "Isometric miniature city of Shanghai at sunset", "size": "2K", "aspect_ratio": "16:9"}'
Show full SKILL.md (210 more words)Show less
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)
bash
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:

bash
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:

json
{
  "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:

json
{
  "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 / size to let the model pick automatically (auto).
  • Input images for editing are auto-compressed to ≤ 4MB / longest edge ≤ 4096px.

© zhayujie, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in skills/image-generation of zhayujie/CowAgent.

  • SKILL.md
  • scripts/generate.py

Open the folder on GitHubat commit 0152064

Compare with similar skills

AI Image Generation and Editing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

AI Image Generation and Editing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AI Image Generation and Editing this skillzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
BlockRun Image GenerationBlockRunAI/ClawRouter6.6k—~2.1kAutomated safety check: PassMIT
AI Image Creatorevolution-foundation/evo-nexus545—~5.1kAutomated safety check: NotesCustom licence
9Router Image Generationdecolua/9router30k—~830Automated safety check: PassMIT
AI Image Creatorcentminmod/my-claude-code-setup2.7k—~8.1kAutomated safety check: NotesMIT
Image Genopen-octo/octo-agent125—~3.1kAutomated safety check: NotesMIT

Similar skills

  • BlockRun Image Generation

    BlockRunAI/ClawRouter

    Generates or edits images through ClawRouter's local image API, with a choice of models and sizes and payment handled automatically through x402.

    6.6k GitHub stars~2.1k tokensUpdated 4 days ago
    Media & CreativeAuto-check passed
  • AI Image Creator

    evolution-foundation/evo-nexus

    Generates PNG images through OpenRouter models, with transparent backgrounds and reference-image edits, and describes existing images with multimodal vision.

    545 GitHub stars~5.1k tokensUpdated 4 mo ago
    Media & CreativeAuto-check: notes
  • Generates images through a 9Router gateway's image endpoint, with model discovery, the request fields and per-provider quirks for OpenAI, Gemini, MiniMax and others.

    30k GitHub stars~830 tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • AI Image Creator

    centminmod/my-claude-code-setup

    Generate, edit-from-reference, or analyze images with AI via OpenRouter (Gemini, GPT Image, Seedream, Qwen, MAI, Grok, FLUX.2, Recraft, Muse, Riverflow; Cloudflare AI Gateway BYOK).

    2.7k GitHub stars~8.1k tokensUpdated yesterday
    Media & CreativeAuto-check: notes
  • Image Gen

    open-octo/octo-agent

    Acquire images as files — generate them with an AI image model (14 providers: OpenAI/gpt-image, Gemini, Qwen, Zhipu, Volcengine, Stability, FLUX, Ideogram, MiniMax, and more), search openly-licensed…

    125 GitHub stars~3.1k tokensUpdated today
    Media & CreativeAuto-check: notes
  • Atlas Cloud

    calesthio/OpenMontage

    Generate or edit images and videos through the Atlas Cloud gateway.

    66k GitHub stars~1.2k tokensUpdated 6 days ago
    Media & CreativeAuto-check passed

More from zhayujie/CowAgent

  • Skill Creator

    zhayujie/CowAgent

    Guides creating, installing and updating agent skills in a workspace: SKILL.md frontmatter, bundled scripts and references, with scripts to scaffold, validate and package.

    47k GitHub stars~4.7k tokensUpdated today
    Auto-check: notes
  • Personal Knowledge Wiki

    zhayujie/CowAgent

    Maintains a structured Markdown knowledge base in a knowledge/ folder by ingesting shared articles, synthesizing conversations and answering questions from it.

    47k GitHub stars~924 tokensUpdated today
    Auto-check passed

Questions about AI Image Generation and Editing

What does AI Image Generation and Editing do?

Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured. py with a JSON argument holding the prompt and optional settings. The script chooses a backend on its own according to which API keys are configured, so the agent should not name a model unless you ask for one and must never invent a model name.

When should I use AI Image Generation and Editing?

AI Image Generation and Editing fits situations like: creating an illustration, icon, poster or photo from a text description; editing an existing image given as a file path or URL; combining several input images into one result; producing a specific aspect ratio such as 16:9 or 9:16.

How do I install AI Image Generation and Editing in Claude Code?

Run `npx skills add zhayujie/CowAgent --skill image-generation -a claude-code`. Or copy the skill folder (skills/image-generation in zhayujie/CowAgent) into .claude/skills/image-generation in your project. Claude Code loads it when a task matches its description.

How do I install AI Image Generation and Editing in Codex?

Run `npx skills add zhayujie/CowAgent --skill image-generation -a codex`. Or copy the skill folder (skills/image-generation in zhayujie/CowAgent) into .agents/skills/image-generation in your project. Codex loads it when a task matches its description.

Can I use AI Image Generation and Editing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zhayujie/CowAgent --skill image-generation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/image-generation, .gemini/skills/image-generation, .github/skills/image-generation and .opencode/skills/image-generation in your project.

What does AI Image Generation and Editing need to run?

Going by SKILL.md and its folder, AI Image Generation and Editing needs Python for the scripts in its folder, the command-line tools its instructions call (python) and credentials named OPENAI_API_KEY, GEMINI_API_KEY, ARK_API_KEY and DASHSCOPE_API_KEY. Our summary lists: Python; An API key for at least one supported image provider.

Does AI Image Generation and Editing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is AI Image Generation and Editing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does AI Image Generation and Editing use?

AI Image Generation and Editing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does AI Image Generation and Editing use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to AI Image Generation and Editing?

Skills that share tags, products or a category with AI Image Generation and Editing: BlockRun Image Generation (BlockRunAI/ClawRouter, 6.6k stars), AI Image Creator (evolution-foundation/evo-nexus, 545 stars), 9Router Image Generation (decolua/9router, 30k stars) and AI Image Creator (centminmod/my-claude-code-setup, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AI Image Generation and Editing?

zhayujie (a GitHub user) maintains it in zhayujie/CowAgent, which has 47,294 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 9, 2026.

Source: zhayujie/CowAgent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.