baoyu-image-gen
Skill27k starsChanged 6 months agoMITView on GitHub
AI image generation with OpenAI GPT Image 2.5, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image, MiniMax, Jimeng, Seedream, Replicate and Agnes APIs. Supports text-to-image, reference images, aspect ratios, and batch generation from saved prompt files. Sequential by default; use batch parallel generation when the user already has multiple prompts or wants stable multi-image throughput. Use when user asks to generate, create, or draw images.
- Reads credentials
- Installs packages
16 other projects use a version of this, 16 of them edited; 1 new project in the last 4 weeks, against 0 the 4 before.
Adopted by
Surging: 1 new project took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- full-aigc-plugins/image-factory-pluginedited, first seen Oct 20, 2026
- xfstudio/skillsedited, first seen Oct 13, 2026
- rockcookies/skillsedited, first seen Oct 13, 2026
- LDJ-creat/media-skillsedited, first seen Oct 9, 2026
- zephyrwang6/myskilledited, first seen Oct 8, 2026
- qihangzhang-272/agent-skill-libraryedited, first seen Oct 2, 2026
Who's talking about JimLiu/baoyu-skills
- 宝玉的技术分享“Agent Skills 设计哲学和实战进化”YouTube · Mar 23, 2026 · 2k views
- Yangjin | AI, Life & Business“我让 Codex 找 GitHub Skill,为什么一个都没直接装?”YouTube · Jul 19, 2026 · 1.4k views
- GitHub Trending Digest“baoyu-skills - GitHub Trending Today”YouTube · Apr 11, 2026 · 236 views
- Find Interesting AI“OPC时代—程序员的营销基础、工具选择、学习建议”YouTube · Jul 5, 2026 · 150 views
- AI워크랩“ChatGPT 보고서 꾸미기 스킬 5개 설치해 써 봤다 — Word 서식 · 테마 10종 · PPT 10장 | GitHub 인기 스킬”YouTube · Oct 21, 2026 · 114 views
The biggest 5 of 66 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 66
Talked about on GitHub, YouTube, Bluesky and the web (66 times).
On GitHub · 50
- Nov 7, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Nov 7, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Nov 6, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Nov 6, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Nov 5, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
45 more on GitHub
- Nov 5, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Nov 4, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Nov 4, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Nov 3, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Nov 3, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Nov 2, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Nov 2, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Nov 1, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Nov 1, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 31, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 31, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 30, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 30, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 29, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 29, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 28, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 28, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 27, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 27, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 26, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 26, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 25, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 25, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 24, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 24, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 23, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 23, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 22, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 22, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 21, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 21, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 20, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 20, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 19, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 19, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 18, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 18, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 17, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 17, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 16, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 16, 2026candidate: baoyu-post-to-wechat — BigPengSays/awesome-creator-skills0 reactions
- Oct 15, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 14, 2026candidate: baoyu-wechat-summary — BigPengSays/awesome-creator-skills0 reactions
- Oct 5, 2026[Candidate] jimliu/baoyu-skills/skills/baoyu-compress-image - baoyu-compress-image — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 5, 2026[Candidate] jimliu/baoyu-skills/skills/baoyu-comic - baoyu-comic — ProSkillsMD/proskills0 reactions · 1 comment
On YouTube · 12
- Mar 23, 2026Agent Skills 设计哲学和实战进化 — 宝玉的技术分享2k views · 5 comments
- Jul 19, 2026我让 Codex 找 GitHub Skill,为什么一个都没直接装? — Yangjin | AI, Life & Business1.4k views
- Apr 11, 2026baoyu-skills - GitHub Trending Today — GitHub Trending Digest236 views
- Jul 5, 2026OPC时代—程序员的营销基础、工具选择、学习建议 — Find Interesting AI150 views · 2 comments
- Oct 21, 2026ChatGPT 보고서 꾸미기 스킬 5개 설치해 써 봤다 — Word 서식 · 테마 10종 · PPT 10장 | GitHub 인기 스킬 — AI워크랩114 views
7 more on YouTube
- May 19, 2026Skills profissionais para Claude Code, Codex, Gemini e Cursor #AI #Shorts — RepoShots105 views · 1 comment
- Mar 11, 2026baoyu-skills hit 9.4K GitHub stars #BaoyuSkills #AgentSkills #ClaudeSkills #CodexSkills #Shorts — Pulse100 views · 1 comment
- May 19, 2026ClaudeCode 实战应用-打通公众号从配图、排版到推送到草稿箱,一气呵成,不再被编辑器束缚 — NicknickAI59 views
- Oct 28, 2026baoyu-skills: This AI agent can create new skills while it works — HubMesh40 views
- Oct 26, 20263 skills de Claude que convierten tu texto en cómics e infografías 🎨 — BarbuPrime IA | Claude Code Vs Codex14 views · 1 comment
- Oct 24, 2026一张产品图,做出两版醒目封面 — 慢半拍的安迪鲁14 views
- Oct 24, 2026用Codex把一页说明变成六步上手图|相机入门 #Shorts — 慢半拍的安迪鲁14 views
On Bluesky · 3
- Aug 11, 2026📦 JimLiu / baoyu-skills ⭐ 24,846 (+50) 🗒 TypeScript — @github-trending-js.bsky.social1 likes and repost
- Apr 11, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 JimLiu / baoyu-skills ⭐ 14,102 (+111) 🗒 TypeScript — @github-trending-js.bsky.social1 likes and repost
- Feb 20, 2026https://github.com/JimLiu/baoyu-skills — @tom-doerr.bsky.social1 likes and repost
On the web · 1
- Nov 2, 2026baoyu-infographic Skill: Turn Text into Infographics | PlugWiki — plugwiki.com
Used with
Projects with it also use deepl, imagemagick-conversion and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
zephyrwang6Skilldeepl
Übersetzt Texte, Dokumente und XLIFF-Dateien via DeepL API. Verwende für Übersetzungen mit /deepl translate, /deepl file oder /deepl xliff.
Also in 4 projects that use this
zephyrwang6Skillimagemagick-conversion
Convert and manipulate images with ImageMagick. Covers format conversion, resizing, batch processing, quality adjustment, and image transformations. Use when user mentions image conversion, resizing images, ImageMagick, magick command, batch image processing, or thumbnail generation.
Also in 4 projects that use this
- +9 more from zephyrwang6
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 16
- zephyrwang6/myskill★ 33925% same
- XY121718/baoyu-skills★ 10318% same
- YuppyChen/ai-wechat★ 6520% same
- LDJ-creat/media-skills★ 2819% same
- ideacco/baoyu-skills-openclaw★ 1418% same
- SpaceZephyr/allSkills★ 1425% same
- xfstudio/skills★ 926% same
- alexkamen123/carmen-quant★ 454% same
- tentacle-pro/skills★ 420% same
- qihangzhang-272/agent-skill-library★ 254% same
6 more not listed
Wrote their own version · 0
None found.
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.
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- release-skillsSkill
- baoyu-article-illustratorSkill
- baoyu-comicSkill
- baoyu-compress-imageSkill
- baoyu-cover-imageSkill
- baoyu-danger-gemini-webSkill
- baoyu-danger-x-to-markdownSkill
- baoyu-diagramSkill
- baoyu-electron-extractSkill
- baoyu-format-markdownSkill
- baoyu-infographicSkill
- baoyu-markdown-to-htmlSkill
- baoyu-post-to-wechatSkill
- baoyu-post-to-weiboSkill
- baoyu-post-to-xSkill
- baoyu-slide-deckSkill
- baoyu-translateSkill
- baoyu-url-to-markdownSkill
- baoyu-wechat-summarySkill
- baoyu-xhs-imagesSkill
- baoyu-youtube-transcriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 1 is common, 8 are distinctive, and 6 are very specific to this project.
1
Common
Most of the 16 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
When this skill prompts the user, follow this tool-selection rule (priority order):
- Distinctive: line 21
Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each …
- Distinctive: line 22
Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call.
- Distinctive: line 32
No image generation until EXTEND.md exists.
- Very specific: line 45
EXTEND.md keys: default provider, quality, aspect ratio, image size, OpenAI image API dialect, default models, batch worker cap, …
- Very specific: line 66
When a real person/character/object must be preserved from reference images:
- Distinctive: line 70
Prefer 2–4 curated existing source refs.
- Distinctive: line 71
Don't use newly generated outputs as refs unless the user asks (drift compounds).
- Very specific: line 137
Fallback: if --provider openai fails only because OPENAI_API_KEY is missing and one of the backends above is available, use it rather than …
- Very specific: line 143
OpenAI: default gpt-image-2.5-flare (fastest).
- Very specific: line 144
Google: default gemini-3-pro-image.
- Very specific: line 145
DashScope: default qwen-image-2.0-pro.
- Distinctive: line 148
Before each generation, display:
- Distinctive: line 162
Read when the user picks that provider or asks for non-default behavior:
- Common: line 178
Only one API key present → that provider
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Image Generation (AI SDK)
User Input Tools
When this skill prompts the user, follow this tool-selection rule (priority order):
- Prefer built-in user-input tools exposed by the current agent runtime — e.g.,
AskUserQuestion,request_user_input,clarify,ask_user, or any equivalent. - Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
- Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.
Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
Script Directory
{baseDir} = this SKILL.md's directory; scripts/... paths are relative to it. Main script: {baseDir}/scripts/main.ts. Batch payload helper: {baseDir}/scripts/build-batch.ts. Resolve ${BUN_X}: prefer bun; else npx -y bun; else suggest brew install oven-sh/bun/bun.
Step 0: Load Preferences (blocking)
No image generation until EXTEND.md exists. Check in order; first hit wins:
| Path | Scope |
.baoyu-skills/baoyu-image-gen/EXTEND.md | Project |
${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-image-gen/EXTEND.md | XDG |
$HOME/.baoyu-skills/baoyu-image-gen/EXTEND.md | User home |
- Found → load and apply. If
default_model.[provider]is null → ask model only. - Not found → run first-time setup (
references/config/first-time-setup.md) via AskUserQuestion to collect provider + model + quality + save location. Save EXTEND.md, then continue.
Legacy: if .baoyu-skills/baoyu-imagine/EXTEND.md exists and the new path doesn't, the runtime renames it to baoyu-image-gen. If both exist, the runtime leaves them alone and uses the new path.
EXTEND.md keys: default provider, quality, aspect ratio, image size, OpenAI image API dialect, default models, batch worker cap, provider-specific batch limits. Schema: references/config/preferences-schema.md.
Usage
More examples (per provider, batch file format): references/usage-examples.md.
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image cat.png
${BUN_X} {baseDir}/scripts/main.ts --prompt "A landscape" --image out.png --ar 16:9 --quality 2k
${BUN_X} {baseDir}/scripts/main.ts --promptfiles system.md content.md --image out.png
${BUN_X} {baseDir}/scripts/main.ts --prompt "Make blue" --image out.png --ref source.png
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider dashscope --model qwen-image-2.0-pro
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider codex-cli --ar 16:9 # Codex login, no OPENAI_API_KEY; needs `codex` on PATH
# Batch; build the payload from outline.md + prompts/ (e.g. baoyu-article-illustrator output)
${BUN_X} {baseDir}/scripts/build-batch.ts --outline outline.md --prompts prompts --output batch.json --images-dir attachments
${BUN_X} {baseDir}/scripts/main.ts --batchfile batch.json --jobs 4Reference-Image Identity Preservation
When a real person/character/object must be preserved from reference images:
- Use short, hard identity language instead of a long generic description: "Use the person/object in the reference image(s) as the same identity. Do not redesign it or create a similar-looking new subject. Only change scene, clothing, pose, lighting, rendering style, and composition. Keep the face/proportions/hair/key accessories/overall identity from the references." With multiple refs, say they are the same subject and jointly define identity.
- Long feature descriptions ("young East Asian woman, oval face, clear eyes...") make the model synthesize a new matching person instead.
- Prefer 2–4 curated existing source refs; many or multi-megabyte refs can destabilize streaming providers.
- Don't use newly generated outputs as refs unless the user asks (drift compounds).
- Too polished/influencer-like → reduce stylized refs, add anti-beautification constraints (no face slimming, eye enlargement, heavy makeup, commercial travel shoot, over-smoothing).
- Younger/older look → keep the face; express age via clothing, posture, scene, styling. Never ask to change facial identity.
Options
| Option | Description |
--prompt <text>, -p | Prompt text |
--promptfiles <files...> | Read prompt from files (concatenated) |
--image <path> | Output image path (required in single-image mode) |
--batchfile <path> | JSON batch file for multi-image generation |
--jobs <count> | Worker count for batch mode (default: auto, max from config, built-in default 10) |
--provider google|openai|azure|openrouter|dashscope|zai|minimax|jimeng|seedream|replicate|codex-cli|agnes | Force provider (default: auto-detect; codex-cli is never auto-selected — must be pinned via CLI or EXTEND.md) |
--model <id>, -m | Model ID — see provider references for defaults and allowed values |
--ar <ratio> | Aspect ratio (16:9, 1:1, 4:3, …) |
--size <WxH> | Explicit size (e.g., 1024x1024; for gpt-image-2.5-* and gpt-image-2, width/height must be multiples of 16, max edge 3840px, ratio no wider than 3:1) |
--quality normal|2k | Quality preset (default: 2k) |
--imageSize 1K|2K|4K | Image size for Google/OpenRouter (default: from quality) |
--imageApiDialect openai-native|ratio-metadata | OpenAI-compatible endpoint dialect — use ratio-metadata for gateways that expect aspect-ratio size plus metadata.resolution |
--ref <files...> | Reference images. Supported by Google multimodal, OpenAI GPT Image edits, Azure OpenAI edits (PNG/JPG only), OpenRouter multimodal models, Replicate supported families, MiniMax subject-reference, Seedream 5.0/4.5/4.0, DashScope wan2.7-image-pro/wan2.7-image. Not supported by Jimeng, Seedream 3.0, SeedEdit 3.0, or any DashScope model outside the wan2.7-image* family |
--n <count> | Number of images. Replicate requires --n 1 (single-output save semantics) |
--json | JSON output |
Environment Variables
| Variable | Description |
OPENAI_API_KEY | OpenAI API key |
AZURE_OPENAI_API_KEY | Azure OpenAI API key |
OPENROUTER_API_KEY | OpenRouter API key |
GOOGLE_API_KEY | Google API key |
DASHSCOPE_API_KEY | DashScope API key |
ZAI_API_KEY (alias BIGMODEL_API_KEY) | Z.AI API key |
MINIMAX_API_KEY | MiniMax API key |
REPLICATE_API_TOKEN | Replicate API token |
JIMENG_ACCESS_KEY_ID, JIMENG_SECRET_ACCESS_KEY | Jimeng (即梦) Volcengine credentials |
ARK_API_KEY | Seedream (豆包) Volcengine ARK API key |
<PROVIDER>_IMAGE_MODEL | Per-provider model override (OPENAI_IMAGE_MODEL, GOOGLE_IMAGE_MODEL, DASHSCOPE_IMAGE_MODEL, ZAI_IMAGE_MODEL/BIGMODEL_IMAGE_MODEL, MINIMAX_IMAGE_MODEL, OPENROUTER_IMAGE_MODEL, REPLICATE_IMAGE_MODEL, JIMENG_IMAGE_MODEL, SEEDREAM_IMAGE_MODEL, AGNES_IMAGE_MODEL) |
AZURE_OPENAI_DEPLOYMENT (alias AZURE_OPENAI_IMAGE_MODEL) | Azure default deployment |
<PROVIDER>_BASE_URL | Per-provider endpoint override |
AZURE_API_VERSION | Azure image API version (default 2025-04-01-preview) |
JIMENG_REGION | Jimeng region (default cn-north-1) |
OPENAI_IMAGE_API_DIALECT | openai-native | ratio-metadata |
OPENROUTER_HTTP_REFERER, OPENROUTER_TITLE | Optional OpenRouter attribution |
BAOYU_IMAGE_GEN_MAX_WORKERS | Override batch worker cap |
BAOYU_IMAGE_GEN_<PROVIDER>_CONCURRENCY | Per-provider concurrency (e.g., BAOYU_IMAGE_GEN_REPLICATE_CONCURRENCY; for codex-cli use BAOYU_IMAGE_GEN_CODEX_CLI_CONCURRENCY) |
BAOYU_IMAGE_GEN_<PROVIDER>_START_INTERVAL_MS | Per-provider start-gap |
BAOYU_CODEX_IMAGEGEN_BIN | Override the codex-imagegen wrapper path for the codex-cli provider (default: bundled scripts/codex-imagegen/main.ts; accepts .ts or legacy .sh/binary) |
BAOYU_CODEX_IMAGEGEN_CACHE_DIR | Enable idempotency cache for the codex-cli provider (off by default) |
BAOYU_CODEX_IMAGEGEN_TIMEOUT_MS | Per-attempt codex exec timeout for the codex-cli provider (default: 300000 ms) |
BAOYU_CODEX_IMAGEGEN_RETRIES | Wrapper-side retry attempts on retryable errors for the codex-cli provider (default: 2) |
BAOYU_CODEX_IMAGEGEN_LOG_FILE | Append JSONL diagnostic log for the codex-cli provider |
Load priority: CLI args > EXTEND.md > env vars > <cwd>/.baoyu-skills/.env > ~/.baoyu-skills/.env
Codex/ChatGPT OAuth Is Not an OpenAI API Key
--provider openai calls the standard OpenAI Images API (/v1/images/generations, /v1/images/edits) and requires OPENAI_API_KEY. A Codex/ChatGPT login is a different entitlement: never paste a Codex OAuth token into OPENAI_API_KEY or just point OPENAI_BASE_URL at a Codex backend. Do not modify the openai provider to silently consume Codex OAuth.
To use a Codex subscription without an API key:
- Codex runtime: native
imagegenskill/tool. - Non-Codex runtime with
codexCLI installed and logged in:--provider codex-cli(preferred; same retry/cache/batch flow). It spawns the bundledscripts/codex-imagegen/main.ts(upstream:packages/baoyu-codex-imagegen/src/main.ts). - Hermes runtime with native
image_generate: use as fallback; state whether refs were passed directly or reconstructed from extracted traits.
Fallback: if --provider openai fails only because OPENAI_API_KEY is missing and one of the backends above is available, use it rather than leaving the user waiting, and say whether it was true reference-image generation or a text reconstruction from visual traits. Details: references/codex-oauth-vs-openai-api-key.md, references/codex-image2-fallback.md.
Model Resolution
Priority for every provider: CLI --model <id> > EXTEND.md default_model.[provider] > env <PROVIDER>_IMAGE_MODEL > built-in default.
- OpenAI: default
gpt-image-2.5-flare(fastest).gpt-image-2.5-sunburstis most capable for complex scenes and precise edits;gpt-image-2,gpt-image-1.5,gpt-image-1and dated snapshots (e.g.gpt-image-2.5-flare-2026-09-08,gpt-image-2-2026-04-21) stay selectable. - Google: default
gemini-3-pro-image.gemini-3.1-flash-imageis faster/cheaper;gemini-3.1-flash-lite-imageis cheapest and 1K-only (--quality 2k/--imageSize 2K|4Kclamp to 1K with a warning). - DashScope: default
qwen-image-2.0-pro;qwen-image-3.0-prois the newest flagship with the same sizing rules. - Azure:
--model/default_model.azureis the deployment name (AZURE_OPENAI_DEPLOYMENT, aliasAZURE_OPENAI_IMAGE_MODEL). Usegpt-image-2.5-flareif the deployment is named after the model, else the exact custom name.
Before each generation, display:
Using [provider] / [model]Switch model: --model <id> | EXTEND.md default_model.[provider] | env <PROVIDER>_IMAGE_MODEL
OpenAI-Compatible Gateway Dialects
provider=openai only means OpenAI-compatible auth/routing, not native image semantics. Set default_image_api_dialect (EXTEND.md), OPENAI_IMAGE_API_DIALECT, or --imageApiDialect:
openai-native: pixelsize(1536x1024) and native quality fields — OpenAI and strict clonesratio-metadata: aspect-ratiosize(16:9) +metadata.resolution(1K|2K|4K) +metadata.orientation— gateways fronting Gemini or similar. Text-to-image only; reference edits needopenai-nativeor a provider with first-class edit support.
Provider-Specific Guides
Read when the user picks that provider or asks for non-default behavior:
| Provider | Reference |
| DashScope (Qwen-Image families, custom sizes) | references/providers/dashscope.md |
| Z.AI (GLM-Image, cogview-4) | references/providers/zai.md |
| MiniMax (image-01, subject-reference) | references/providers/minimax.md |
OpenRouter (multimodal models, /chat/completions flow) | references/providers/openrouter.md |
| Replicate (nano-banana, Seedream, Wan) | references/providers/replicate.md |
Codex CLI (wraps bundled scripts/codex-imagegen/; Codex login, no OPENAI_API_KEY) | references/providers/codex-cli.md |
| Agnes (agnes-image-2.5-flash, reference-image support) | references/providers/agnes.md |
Provider Selection
--refprovided + no--provider→ auto-select Google → OpenAI → Azure → OpenRouter → Replicate → Seedream → MiniMax → Agnes (MiniMax subject reference is specialized for character/portrait consistency)--providerspecified → use it (with--ref, must be google/openai/azure/openrouter/replicate/seedream/minimax/codex-cli/agnes)- Only one API key present → that provider
- Multiple keys → Google → OpenAI → Azure → OpenRouter → DashScope → Z.AI → MiniMax → Replicate → Jimeng → Seedream → Agnes
codex-cliis never auto-selected — pin viadefault_provider: codex-clior--provider codex-cli. Runscodex execthrough the bundledscripts/codex-imagegen/main.ts(withbun) on the user's Codex subscription; requirescodexonPATHwith an activecodex login.
Quality Presets
| Preset | Google imageSize | OpenAI size | OpenRouter size | Replicate resolution | Use case |
normal | 1K | 1024px target | 1K | 1K | Quick previews |
2k (default) | 2K | 2048px target | 2K | 2K | Covers, illustrations, infographics |
Google/OpenRouter imageSize can be overridden with --imageSize 1K|2K|4K.
OpenAI native gpt-image-2.5-* / gpt-image-2: normal → quality=medium + low-latency valid size near the ratio; 2k → quality=high + 2048px-class sizes (2048x2048, 2048x1152, 1152x2048). Use explicit --size for custom or 4K (e.g. 3840x2160).
Aspect Ratios
Supported: 1:1, 16:9, 9:16, 4:3, 3:4, 2.35:1.
- Google multimodal:
imageConfig.aspectRatio - OpenAI:
gpt-image-2.5-*/gpt-image-2use the closest valid custom size; older GPT Image and DALL·E use the closest fixed size - OpenRouter:
imageGenerationOptions.aspect_ratio; with only--size <WxH>, the ratio is inferred - Replicate: model-specific —
google/nano-banana*usesaspect_ratio,bytedance/seedream-*uses documented Replicate ratios, Wan 2.7 maps--arto a concretesize - MiniMax: official
aspect_ratiovalues;--size <WxH>without--arsendswidth/heightforimage-01
Generation Mode
Default: sequential. Batch parallel: automatic when --batchfile has 2+ pending tasks.
| Situation | Prefer |
| One image, or 1-2 simple images | Sequential |
| Multiple images with saved prompt files | Batch (--batchfile) — shared throttling/retries |
| Each image still needs its own reasoning / prompt writing / style exploration | Subagents |
Input is outline.md + prompts/ (e.g. from baoyu-article-illustrator) | Batch, payload built with {baseDir}/scripts/build-batch.ts |
Once prompt files are saved and the task is "generate all of these", prefer batch over subagents.
Parallel behavior: worker count auto, capped by config (built-in default 10), override with --jobs <count>; provider-specific throttling applies only in batch mode; each image retries up to 3 attempts; final output reports success count, failure count, and per-image failure reasons.
Error Handling
- Missing API key → error with setup instructions (for OpenAI see the Codex fallback above)
- Generation failure → auto-retry up to 3 attempts per image
- Invalid aspect ratio → warning, proceed with default
- Reference images with unsupported provider/model → error with fix hint
Extension Support
Custom configurations via EXTEND.md. See Step 0 for paths and schema.
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.

