ai-image-generator
Skill2 starsChanged 4 months agoMITView on GitHub
Use this skill whenever the user wants to generate, create, edit, or restyle an AI image through the agent's native image generation capability or configured image APIs such as GPT-image2, Nano Banana-compatible APIs, SiliconFlow Qwen Image, or OpenAI GPT Image-compatible APIs. Direct mode sends the user's prompt directly to the model. Pro mode only checks whether the user's prompt has the basic elements needed for generation, asks for missing information, then sends the completed user-approved prompt to the model.
- Reads credentials
- Installs packages
4 other projects use a version of this.
Adopted by
Most recently taken up by
- ook826092-cloud/skillstheir own version, first seen Oct 13, 2026
- SkotAlexsander/skillstheir own version, first seen Sep 16, 2026
- TashanGKD/tashan-cursor-skillstheir own version, first seen Mar 25, 2026
- paolomoz/skillstheir own version, first seen Feb 3, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- TashanGKD/tashan-cursor-skills★ 21same name
- paolomoz/skills★ 4same name
- ook826092-cloud/skills★ 1same name
- SkotAlexsander/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 18 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use this skill as a general-purpose image generation component.
- Distinctive: line 15
Use this global priority:
- Distinctive: line 31
Pro mode: check whether the user's prompt has enough basic generation information.
- Distinctive: line 33
Do not rewrite, optimize, stylize, expand, or re-rank the user's prompt unless the user explicitly asks you to write final copy.
- Distinctive: line 40
Use Direct mode by default.
- Distinctive: line 48
Do not add output form, style, composition, quality, text, brand, safety, or negative prompt constraints in Direct mode.
- Distinctive: line 52
Use this priority for image size and aspect ratio:
- Very specific: line 54
If the user or calling skill explicitly provides --size or --aspect-ratio, use that value.
- Very specific: line 56
If no explicit size is provided, inspect the raw user prompt for an explicit size or ratio such as 1024x1024, 16:9, 9:16, or 2.35:1.
- Very specific: line 58
If the prompt has no explicit size, match platform/use-case keywords against references/platform-image-specs.json.
- Distinctive: line 60
If nothing matches, do not invent a size.
- Distinctive: line 65
Check size resolution without generating an image:
- Distinctive: line 73
Use Pro mode only when the user asks for:
- Distinctive: line 87
Check whether the user's prompt contains enough information for generation:
- Distinctive: line 98
Only ask for missing items that materially affect generation.
- Distinctive: line 102
When information is missing, ask concise questions before generation:
- Distinctive: line 111
After the user answers, create a completed prompt that combines:
- Distinctive: line 115
no extra creative rewriting.
- Distinctive: line 121
Use this helper to inspect missing prompt elements:
- Very specific: line 159
Only pass --size or --aspect-ratio when the caller already has an explicit user requirement.
- Distinctive: line 197
Default script/API provider order:
- Distinctive: line 265
If the environment supports local image rendering, show the image:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Image Generator
Use this skill as a general-purpose image generation component. Other skills can call it whenever they need image generation instead of re-implementing image provider routing, API calls, output parsing, or common platform size defaults.
Provider Priority
Use this global priority:
- Agent-native image generation, when the current agent/runtime provides a built-in image generation tool and the user did not explicitly request a third-party API.
- Script/API
--provider auto, whose fallback order isgpt-image2,nano-banana,siliconflow-qwen-image, thenopenai. - A specific provider pinned by the user or calling skill.
The bundled scripts/generate-image.sh cannot call agent-native tools by
itself. It only handles configured API providers. Agent-native generation is an
instruction for the agent using this skill.
There are only two modes:
- Direct mode: send the user's prompt or keywords directly to the selected image model.
- Pro mode: check whether the user's prompt has enough basic generation information. If something important is missing, ask the user to fill it in. After the user confirms the missing information, send the completed prompt to the model.
Do not rewrite, optimize, stylize, expand, or re-rank the user's prompt unless the user explicitly asks you to write final copy. Do not use a case library or prompt examples to transform the user's intent.
This skill may infer image size or aspect-ratio API parameters from the user's stated use case. Size inference is not prompt rewriting.
Direct Mode
Use Direct mode by default.
The final prompt is the user's original input:
[user prompt or keywords]Do not add output form, style, composition, quality, text, brand, safety, or negative prompt constraints in Direct mode. Provider parameters such as aspect ratio, image size, number of images, or input image path may still be passed as API parameters.
Size Resolution
Use this priority for image size and aspect ratio:
- If the user or calling skill explicitly provides
--sizeor--aspect-ratio, use that value. - If no explicit size is provided, inspect the raw user prompt for an explicit
size or ratio such as
1024x1024,16:9,9:16, or2.35:1. - If the prompt has no explicit size, match platform/use-case keywords against
references/platform-image-specs.json. - If nothing matches, do not invent a size. Let the provider or script default apply.
The size resolver must not change the prompt text.
Check size resolution without generating an image:
bash scripts/resolve-image-spec.sh --query "生成一张微信公众号头图,主题是 AI 生图模型配置"Pro Mode
Use Pro mode only when the user asks for:
- Pro mode
- prompt checking
- help completing a prompt
- guidance before generation
- "帮我看看提示词是否完整"
- "缺什么你问我"
- "先帮我确认信息再生成"
Pro mode is not prompt optimization. It is a missing-information guide.
Basic Elements To Check
Check whether the user's prompt contains enough information for generation:
subject: what should appear in the image.purpose: what the image will be used for, if relevant.output_type: poster, cover, product photo, avatar, illustration, wallpaper, etc.aspect_ratio_or_size: ratio or size, if the target platform matters.style_or_mood: visual style, mood, realism level, or brand mood, if the user cares.visible_text: exact text to appear, or "no text", if the image may include text.reference_image: whether an input image should be used, and what must be preserved.provider: only when the user cares or multiple configured providers are available.
Only ask for missing items that materially affect generation. If the user clearly does not care, do not ask.
Pro Interaction
When information is missing, ask concise questions before generation:
我先补齐几个会影响生成结果的信息:
1. 图片比例/尺寸要用什么?如果你不指定,我按 [default]。
2. 图片里是否需要出现文字?如果需要,请给 exact text。
3. 是否有参考图,或者需要保持某个主体不变?After the user answers, create a completed prompt that combines:
- the user's original wording,
- the user's answers to missing questions,
- no extra creative rewriting.
Then generate the image.
Helper Script
Use this helper to inspect missing prompt elements:
bash scripts/build-prompt-brief.sh --query "<user prompt>"The helper returns:
- inferred image type,
- likely aspect ratio,
- detected prompt elements,
- missing elements,
- questions to ask,
- Direct prompt instruction,
- Pro completion instruction.
Image Generation
Generate through Nano Banana-compatible providers:
bash scripts/generate-image.sh \
--provider auto \
--prompt "<user or completed prompt>" \
--aspect-ratio 1:1 \
--output-dir ./outputsFor other skills, the standard component call is:
bash /absolute/path/to/ai-image-generator/scripts/generate-image.sh \
--provider auto \
--prompt "<raw user prompt>" \
--output-dir "<run output images dir>" \
--output-prefix "<asset id>"Only pass --size or --aspect-ratio when the caller already has an explicit
user requirement. Otherwise let ai-image-generator resolve known platform
defaults.
Provider choices:
- Agent-native image generation: default at the agent level when available.
auto: script/API default. Trygpt-image2,nano-banana,siliconflow-qwen-image, thenopenai.gpt-image2: OpenAI-compatible GPT-image2 proxy, for example Yunwu.nano-banana: Nano Banana-compatible API.siliconflow-qwen-image: SiliconFlowQwen/Qwen-Image.openai: generic OpenAI GPT Image-compatible API.
Generate through a specific provider:
bash scripts/generate-image.sh \
--provider gpt-image2 \
--prompt "<user or completed prompt>" \
--size 1024x1024 \
--output-dir ./outputsFor image-to-image, pass reference images:
bash scripts/generate-image.sh \
--provider nano-banana \
--input-image /absolute/path/reference.png \
--prompt "<edit instruction>" \
--aspect-ratio 1:1 \
--output-dir ./outputsConfiguration
Each user configures their own API keys and URLs in .env, ~/.ai-image-generator/.env, or ~/.config/ai-image-generator/.env.
Default script/API provider order:
IMAGE_PROVIDER=autoAt the agent level, use the agent's built-in image generation capability first
when available. Use IMAGE_PROVIDER=auto only when calling the bundled API
script or when the user explicitly asks for API/provider generation.
GPT-image2 through an OpenAI-compatible proxy such as Yunwu:
GPT_IMAGE2_BASE_URL="https://yunwu.ai"
GPT_IMAGE2_MODEL="gpt-image-2-all"
GPT_IMAGE2_API_KEY="your_api_key_here"Nano Banana-compatible provider:
NANO_BANANA_API_URL="https://your-provider.example/v1beta/models/your-model:generateContent"
NANO_BANANA_API_KEY="your_api_key_here"Yunwu Nano Banana-compatible aliases:
YUNWU_NANO_BANANA_BASE_URL="https://yunwu.ai"
YUNWU_NANO_BANANA_MODEL="gemini-3.1-flash-image-preview"
YUNWU_NANO_BANANA_API_KEY="your_api_key_here"SiliconFlow Qwen Image:
SILICONFLOW_BASE_URL="https://api.siliconflow.cn/v1/images/generations"
SILICONFLOW_MODEL="Qwen/Qwen-Image"
SILICONFLOW_API_KEY="your_api_key_here"OpenAI GPT Image-compatible provider:
OPENAI_IMAGE_API_KEY="your_openai_or_proxy_key_here"
OPENAI_IMAGE_MODEL="gpt-image-1.5"
OPENAI_IMAGE_GENERATE_URL="https://api.openai.com/v1/images/generations"
OPENAI_IMAGE_EDIT_URL="https://api.openai.com/v1/images/edits"Validate configuration:
bash scripts/check-config.shOutput Handling
After generation, return:
- generated image path(s),
- provider used,
- aspect ratio or size,
image_spec.source, showing whether the size came fromuser_explicit_cli,user_explicit_prompt,matched_spec,not_found, orprovider_default,- prompt sent to the model,
- raw JSON path for debugging.
If the environment supports local image rendering, show the image:
Troubleshooting
- Missing API key: run
bash scripts/check-config.sh. - Missing
jq: install it first, for examplebrew install jq. - Provider returns no image: inspect the saved raw JSON response.
- OpenAI model mismatch: set
OPENAI_IMAGE_MODELto the model supported by the user's account or proxy.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

