- name
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 image
SKILL.md
The skill file stays in the publisher's repository.
Paste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add JimLiu/baoyu-skills --skill baoyu-image-gen -a cursor -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add JimLiu/baoyu-skills --skill baoyu-image-gen -a claude-code -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add JimLiu/baoyu-skills --skill baoyu-image-gen -a codex -yPaste the copied command in a terminal. It installs this SKILL.md into that agent.
npx skills add JimLiu/baoyu-skills --skill baoyu-image-gen -a grok -ySend the copied message in a Grok Bot chat. The Bot fetches this SKILL.md from GitHub and adds it to the skills all your Bots share.
Install this skill: https://github.com/JimLiu/baoyu-skills/tree/HEAD/skills/baoyu-image-genFrom the publisher
When this skill prompts the user, follow this tool-selection rule (priority order):
AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
{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.
No image generation until EXTEND.md exists. Check in order; first hit wins:
default_model.[provider] is null → ask model only.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.
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 4
When a real person/character/object must be preserved from reference images:
Load priority: CLI args > EXTEND.md > env vars > <cwd>/.baoyu-skills/.env > ~/.baoyu-skills/.env
--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:
imagegen skill/tool.codex CLI installed and logged in: --provider codex-cli (preferred; same retry/cache/batch flow). It spawns the bundled scripts/codex-imagegen/main.ts (upstream: packages/baoyu-codex-imagegen/src/main.ts).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.
Priority for every provider: CLI --model <id> > EXTEND.md default_model.[provider] > env <PROVIDER>_IMAGE_MODEL > built-in default.
gpt-image-2.5-flare (fastest). gpt-image-2.5-sunburst is most capable for complex scenes and precise edits; gpt-image-2, gpt-image-1.5, gpt-image-1 and dated snapshots (e.g. gpt-image-2.5-flare-2026-09-08, gpt-image-2-2026-04-21) stay selectable.gemini-3-pro-image. gemini-3.1-flash-image is faster/cheaper; gemini-3.1-flash-lite-image is cheapest and 1K-only (--quality 2k / --imageSize 2K|4K clamp to 1K with a warning).qwen-image-2.0-pro; qwen-image-3.0-pro is the newest flagship with the same sizing rules.--model / default_model.azure is the deployment name (AZURE_OPENAI_DEPLOYMENT, alias AZURE_OPENAI_IMAGE_MODEL). Use gpt-image-2.5-flare if 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_MODELprovider=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: pixel size (1536x1024) and native quality fields — OpenAI and strict clonesratio-metadata: aspect-ratio size (16:9) + metadata.resolution (1K|2K|4K) + metadata.orientation — gateways fronting Gemini or similar. Text-to-image only; reference edits need openai-native or a provider with first-class edit support.Read when the user picks that provider or asks for non-default behavior:
--ref provided + no --provider → auto-select Google → OpenAI → Azure → OpenRouter → Replicate → Seedream → MiniMax → Agnes (MiniMax subject reference is specialized for character/portrait consistency)--provider specified → use it (with --ref, must be google/openai/azure/openrouter/replicate/seedream/minimax/codex-cli/agnes)codex-cli is never auto-selected — pin via default_provider: codex-cli or --provider codex-cli. Runs codex exec through the bundled scripts/codex-imagegen/main.ts (with bun) on the user's Codex subscription; requires codex on PATH with an active codex login.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).
Supported: 1:1, 16:9, 9:16, 4:3, 3:4, 2.35:1.
imageConfig.aspectRatiogpt-image-2.5-* / gpt-image-2 use the closest valid custom size; older GPT Image and DALL·E use the closest fixed sizeimageGenerationOptions.aspect_ratio; with only --size <WxH>, the ratio is inferredgoogle/nano-banana* uses aspect_ratio, bytedance/seedream-* uses documented Replicate ratios, Wan 2.7 maps --ar to a concrete sizeaspect_ratio values; --size <WxH> without --ar sends width/height for image-01Default: sequential. Batch parallel: automatic when --batchfile has 2+ pending tasks.
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.
Custom configurations via EXTEND.md. See Step 0 for paths and schema.
© 2026 Skills Rack.
---name: baoyu-image-gendescription: AI image generation with OpenAI GPT Image 2.5, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image…---# skills/baoyu-image-gen/SKILL.mdOverview
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.
FAQ
Download skills/baoyu-image-gen/SKILL.md from the publisher, or copy the path and open the repository. PlugMCP lists the skill and does not host the file.
The publisher keeps it at https://github.com/JimLiu/baoyu-skills.
Claude, Cursor, Codex, and Grok Build can read a SKILL.md you add from the publisher's repository. Grok Bot installs it when you send the skill's GitHub folder link in a chat.
--n <count> | Number of images. Replicate requires --n 1 (single-output save semantics) |
--json | JSON output |
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 |