Install
$ agentstack add skill-chemny-ai-image-generator-ai-image-generator ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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.
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, or 2.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 ""
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 "" \
--aspect-ratio 1:1 \
--output-dir ./outputs
For other skills, the standard component call is:
bash /absolute/path/to/ai-image-generator/scripts/generate-image.sh \
--provider auto \
--prompt "" \
--output-dir "" \
--output-prefix ""
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:
auto: 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 "" \
--size 1024x1024 \
--output-dir ./outputs
For image-to-image, pass reference images:
bash scripts/generate-image.sh \
--provider nano-banana \
--input-image /absolute/path/reference.png \
--prompt "" \
--aspect-ratio 1:1 \
--output-dir ./outputs
Configuration
Each user configures their own API keys and URLs in .env, ~/.ai-image-generator/.env, or ~/.config/ai-image-generator/.env.
Default provider order:
IMAGE_PROVIDER=auto
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.sh
Output 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, or provider_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.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: chemny
- Source: chemny/ai-image-generator
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.