Agent skill

Baoyu Image Gen

by JimLiu in JimLiu/baoyu-skills

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.

MITAuto-check: notesMedia & Creative

Install Baoyu Image Gen

skills CLI
$ npx skills add JimLiu/baoyu-skills --skill baoyu-image-gen -a claude-code

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

GitHub CLI
$ gh skill install JimLiu/baoyu-skills baoyu-image-gen --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/JimLiu/baoyu-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/baoyu-image-gen .claude/skills/baoyu-image-gen && 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
baoyu-image-gen
GitHub stars
27k
Used in
1 other repo
Token cost
~5.3k tokens
SKILL.md length
2,136 words
Files
50 (incl. scripts, references)
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Works in 3 steps: Prefer built-in user-input tools exposed… → Fallback: if no such tool exists, emit a… → Batching: if the tool supports multiple…
  • Already has multiple prompts
  • SKILL.md covers User Input Tools, Script Directory, Step 0: Load Preferences ⛔… and Usage, plus 13 more sections
  • Runs TypeScript scripts from its folder; calls codex, npx and brew; needs OPENAI_API_KEY and AZURE_OPENAI_API_KEY

What it does

Baoyu Image Gen is an agent skill from JimLiu/baoyu-skills. 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.

Its SKILL.md is about 5.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 54 other files, including scripts and reference files (for example `references/codex-image2-fallback.md`, `references/codex-oauth-vs-openai-api-key.md` and `references/config/first-time-setup.md`).

It sits in Media & Creative, covering Image generation. It works with Azure OpenAI, MiniMax, OpenAI and OpenRouter. The licence is MIT.

When your agent uses it

  • Already has multiple prompts
  • Wants stable multi-image throughput
  • User asks to generate

Example prompts

  • “/baoyu-image-gen”

Requirements

  • Node.js
  • A credential in OPENAI_API_KEY
  • A credential in AZURE_OPENAI_API_KEY

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or…
  2. 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…
  3. Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question…

What it can do on your machine

Read from SKILL.md and the folder at commit 1567581. 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 3 files in scripts/ (TypeScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • codex
    • npx
    • brew

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

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    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
    • AZURE_OPENAI_API_KEY
    • OPENROUTER_API_KEY
    • GOOGLE_API_KEY
    • DASHSCOPE_API_KEY
    • ZAI_API_KEY
    • BIGMODEL_API_KEY
    • MINIMAX_API_KEY
    • REPLICATE_API_TOKEN
    • JIMENG_ACCESS_KEY_ID
    • JIMENG_SECRET_ACCESS_KEY
    • ARK_API_KEY

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

Context cost

Baoyu Image Gen loads about 5.3k tokens when it runs, and up to ~17k if it reads all its reference files. Until then it costs about 118 tokens; SKILL.md has 2,136 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~118
When it runs · the whole SKILL.md, loaded when a task matches
~5.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~17k

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

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:155
    END.md > env vars > `<cwd>/.baoyu-skills/.env` > `~/.baoyu-skills/.env`

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 JimLiu/baoyu-skills at commit 1567581, republished under its MIT licence (© JimLiu). 2,136 words, ~5,317 tokens.

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

Image Generation (AI SDK)

Official API-based image generation. Supports OpenAI GPT Image 2.5, Azure OpenAI, Google, OpenRouter, DashScope (阿里通义万象), Z.AI GLM-Image, MiniMax, Jimeng (即梦), Seedream (豆包), Replicate and Agnes.

User Input Tools

When this skill prompts the user, follow this tool-selection rule (priority order):

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.
  2. 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.
  3. 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. All scripts/... paths below are relative to {baseDir}. 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

This step MUST complete before any image generation — generation is blocked until EXTEND.md exists.

Check these paths in order; first hit wins:

PathScope
.baoyu-skills/baoyu-image-gen/EXTEND.mdProject
${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-image-gen/EXTEND.mdXDG
$HOME/.baoyu-skills/baoyu-image-gen/EXTEND.mdUser home
  • Found → load, parse, apply. If default_model.[provider] is null → ask model only.
  • Not found → run first-time setup (references/config/first-time-setup.md) using AskUserQuestion to collect provider + model + quality + save location. Save EXTEND.md, then continue. Do not generate images before this completes.

Legacy compatibility: 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, default quality, default aspect ratio, default image size, OpenAI image API dialect, default models, batch worker cap, provider-specific batch limits. Schema: references/config/preferences-schema.md.

Usage

Minimum working examples — see references/usage-examples.md for the full set including per-provider invocations and batch mode.

Identity-preserving reference prompts

When the user wants a real person/character/object preserved from reference images, do not replace the reference with a long generic description. Prefer short, hard identity-preservation language:

  • "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."
  • If using multiple references, state that they are the same subject and should jointly define identity.

Pitfall: long descriptions like "young East Asian woman, oval face, clear eyes..." can cause the model to synthesize a new person matching the description instead of preserving the referenced person.

bash
# Basic
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image cat.png

# With aspect ratio and high quality
${BUN_X} {baseDir}/scripts/main.ts --prompt "A landscape" --image out.png --ar 16:9 --quality 2k

# Prompt from files
${BUN_X} {baseDir}/scripts/main.ts --promptfiles system.md content.md --image out.png

# With reference image
${BUN_X} {baseDir}/scripts/main.ts --prompt "Make blue" --image out.png --ref source.png

# Specific provider
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider dashscope --model qwen-image-2.0-pro

# OpenAI GPT Image 2
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider openai --model gpt-image-2.5-flare

# Codex CLI (uses logged-in Codex subscription — no OPENAI_API_KEY required; requires `codex` on PATH)
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider codex-cli --ar 16:9

# Batch mode
${BUN_X} {baseDir}/scripts/main.ts --batchfile batch.json --jobs 4

# Build a batch file 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

Reference-Image Identity Preservation

When the user wants a person/object preserved from reference images:

  • Prefer a small curated set of existing source references (usually 2–4) over many images; large multi-megabyte refs can destabilize streaming providers.
  • Make the prompt say the references are the same subject and the output must use that identity. Avoid long generic facial-feature descriptions that can cause the model to synthesize a new similar-looking person.
  • Do not use newly generated outputs as references unless the user explicitly asks; generated refs compound drift.
  • If results become too polished or influencer-like, reduce stylized refs and add explicit anti-beautification constraints (no face slimming, eye enlargement, heavy makeup, commercial travel shoot, over-smoothing).
  • If the subject should look younger/older, preserve the face and express age through clothing, posture, scene, and styling; do not ask the model to change facial identity.

Options

OptionDescription
--prompt <text>, -pPrompt 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|agnesForce provider (default: auto-detect; codex-cli is never auto-selected — must be pinned via CLI or EXTEND.md)
--model <id>, -mModel 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|2kQuality preset (default: 2k)
--imageSize 1K|2K|4KImage size for Google/OpenRouter (default: from quality)
--imageApiDialect openai-native|ratio-metadataOpenAI-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)
--jsonJSON output

Environment Variables

VariableDescription
OPENAI_API_KEYOpenAI API key
AZURE_OPENAI_API_KEYAzure OpenAI API key
OPENROUTER_API_KEYOpenRouter API key
GOOGLE_API_KEYGoogle API key
DASHSCOPE_API_KEYDashScope API key
ZAI_API_KEY (alias BIGMODEL_API_KEY)Z.AI API key
MINIMAX_API_KEYMiniMax API key
REPLICATE_API_TOKENReplicate API token
JIMENG_ACCESS_KEY_ID, JIMENG_SECRET_ACCESS_KEYJimeng (即梦) Volcengine credentials
ARK_API_KEYSeedream (豆包) Volcengine ARK API key
<PROVIDER>_IMAGE_MODELPer-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_URLPer-provider endpoint override
AZURE_API_VERSIONAzure image API version (default 2025-04-01-preview)
JIMENG_REGIONJimeng region (default cn-north-1)
OPENAI_IMAGE_API_DIALECTopenai-native | ratio-metadata
OPENROUTER_HTTP_REFERER, OPENROUTER_TITLEOptional OpenRouter attribution
BAOYU_IMAGE_GEN_MAX_WORKERSOverride batch worker cap
BAOYU_IMAGE_GEN_<PROVIDER>_CONCURRENCYPer-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_MSPer-provider start-gap
BAOYU_CODEX_IMAGEGEN_BINOverride 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_DIREnable idempotency cache for the codex-cli provider (off by default)
BAOYU_CODEX_IMAGEGEN_TIMEOUT_MSPer-attempt codex exec timeout for the codex-cli provider (default: 300000 ms)
BAOYU_CODEX_IMAGEGEN_RETRIESWrapper-side retry attempts on retryable errors for the codex-cli provider (default: 2)
BAOYU_CODEX_IMAGEGEN_LOG_FILEAppend 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 --model gpt-image-2.5-flare uses the standard OpenAI Images API (/v1/images/generations or /v1/images/edits) and requires OPENAI_API_KEY. A Codex or ChatGPT desktop login is a different entitlement and is not a drop-in replacement for OPENAI_API_KEY; do not paste a Codex OAuth token into OPENAI_API_KEY or only set OPENAI_BASE_URL to a Codex backend.

If the user wants to use their Codex subscription / GPT Image 2 entitlement without an OpenAI API key, route through a Codex-native backend instead of this skill's openai provider:

  • In Codex runtime: use the native imagegen skill/tool.
  • In non-Codex runtimes with codex CLI installed and logged in: use baoyu-image-gen --provider codex-cli (preferred — it gives you the same retry / cache / batch flow as every other provider). The provider spawns the bundled scripts/codex-imagegen/main.ts; the same code lives upstream at packages/baoyu-codex-imagegen/src/main.ts for standalone callers.
  • In Hermes runtimes with a native image_generate tool: use that tool as a fallback, and state whether reference images were passed directly or reconstructed from extracted traits.

Do not modify the existing openai provider to silently consume Codex OAuth. The first-class Codex-CLI path is the dedicated codex-cli provider, which has its own auth (Codex login), route (codex exec), request shape, and tests. See references/codex-oauth-vs-openai-api-key.md.

Model Resolution

Priority (highest → lowest) applies to every provider:

  1. CLI flag --model <id>
  2. EXTEND.md default_model.[provider]
  3. Env var <PROVIDER>_IMAGE_MODEL
  4. Built-in default

For OpenAI, the built-in default is gpt-image-2.5-flare (fast, lowest latency). gpt-image-2.5-sunburst is the most capable variant for complex scenes and precise edits; gpt-image-2, gpt-image-1.5, gpt-image-1, and dated GPT Image snapshots (e.g. gpt-image-2.5-flare-2026-09-08, gpt-image-2-2026-04-21) remain selectable with --model or OPENAI_IMAGE_MODEL.

For Google, the built-in default is gemini-3-pro-image. gemini-3.1-flash-image is the faster low-cost option, and gemini-3.1-flash-lite-image is the cheapest — it only produces 1K output, so --quality 2k / --imageSize 2K|4K is clamped to 1K with a warning.

For DashScope, the built-in default is qwen-image-2.0-pro; qwen-image-3.0-pro is the newest flagship and uses the same sizing rules.

For Azure, --model / default_model.azure is the Azure deployment name. AZURE_OPENAI_DEPLOYMENT is the preferred env var; AZURE_OPENAI_IMAGE_MODEL is kept as a backward-compatible alias. If your Azure deployment is named after the underlying model, use gpt-image-2.5-flare; otherwise use the exact custom deployment name.

EXTEND.md overrides env vars: if EXTEND.md sets default_model.google: "gemini-3-pro-image" and the env var sets GOOGLE_IMAGE_MODEL=gemini-3.1-flash-image, EXTEND.md wins.

Display model info before each generation:

  • Using [provider] / [model]
  • Switch model: --model <id> | EXTEND.md default_model.[provider] | env <PROVIDER>_IMAGE_MODEL
Show full SKILL.md (798 more words)Show less

OpenAI-Compatible Gateway Dialects

provider=openai means the auth and routing entrypoint is OpenAI-compatible. It does not guarantee the upstream image API uses OpenAI native semantics. When a gateway expects a different wire format, set default_image_api_dialect in EXTEND.md, OPENAI_IMAGE_API_DIALECT, or --imageApiDialect:

  • openai-native: pixel size (1536x1024) and native OpenAI quality fields
  • ratio-metadata: aspect-ratio size (16:9) plus metadata.resolution (1K|2K|4K) and metadata.orientation

Use openai-native for the OpenAI native API or strict clones; try ratio-metadata for compatibility gateways in front of Gemini or similar models. Current limitation: ratio-metadata applies only to text-to-image; reference-image edits still need openai-native or a provider with first-class edit support.

Provider-Specific Guides

Each provider has its own quirks (model families, size rules, ref support, limits). Read these when the user picks that provider or asks for non-default behavior:

ProviderReference
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

  1. --ref provided + no --provider → auto-select Google → OpenAI → Azure → OpenRouter → Replicate → Seedream → MiniMax → Agnes (MiniMax's subject reference is more specialized toward character/portrait consistency)
  2. --provider specified → use it (if --ref, must be google/openai/azure/openrouter/replicate/seedream/minimax/codex-cli/agnes)
  3. Only one API key present → use that provider
  4. Multiple keys → default priority: Google → OpenAI → Azure → OpenRouter → DashScope → Z.AI → MiniMax → Replicate → Jimeng → Seedream → Agnes
  5. codex-cli is never auto-selected — set default_provider: codex-cli in EXTEND.md or pass --provider codex-cli. It spawns codex exec via the bundled scripts/codex-imagegen/main.ts TS entrypoint (run with bun) and uses the user's Codex subscription (no OPENAI_API_KEY). Requires codex on PATH with an active codex login.

Quality Presets

PresetGoogle imageSizeOpenAI sizeOpenRouter sizeReplicate resolutionUse case
normal1K1024px target1K1KQuick previews
2k (default)2K2048px target2K2KCovers, illustrations, infographics

Google/OpenRouter imageSize can be overridden with --imageSize 1K|2K|4K.

For OpenAI native gpt-image-2.5-* and gpt-image-2, normal maps to quality=medium and a low-latency valid size near the requested aspect ratio; 2k maps to quality=high and 2048px-class sizes such as 2048x2048, 2048x1152, or 1152x2048. Use explicit --size for valid custom or 4K outputs, 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-* and gpt-image-2 use the closest valid custom size for the requested ratio; older GPT Image and DALL·E models use their closest supported fixed size
  • OpenRouter: imageGenerationOptions.aspect_ratio; if only --size <WxH> is given, the ratio is inferred
  • Replicate: behavior is model-specific — google/nano-banana* uses aspect_ratio, bytedance/seedream-* uses documented Replicate ratios, Wan 2.7 maps --ar to a concrete size
  • MiniMax: official aspect_ratio values; if --size <WxH> is given without --ar, sends width/height for image-01

Generation Mode

Default: sequential. Batch parallel: enabled automatically when --batchfile contains 2+ pending tasks.

SituationPreferWhy
One image, or 1-2 simple imagesSequentialLower coordination overhead, easier debugging
Multiple images with saved prompt filesBatch (--batchfile)Reuses finalized prompts, applies shared throttling/retries, predictable throughput
Each image still needs its own reasoning / prompt writing / style explorationSubagentsWork is still exploratory, each needs independent analysis
Input is outline.md + prompts/ (e.g. from baoyu-article-illustrator)Batch — use {baseDir}/scripts/build-batch.ts to assemble the payloadThe outline + prompt files already contain everything needed

Rule of thumb: once prompt files are saved and the task is "generate all of these", prefer batch over subagents. Use subagents only when generation is coupled with per-image thinking or divergent creative exploration.

Parallel behavior:

  • Default worker count is automatic, capped by config, built-in default 10
  • Provider-specific throttling applies only in batch mode; defaults are tuned for throughput while avoiding RPM bursts
  • Override with --jobs <count>
  • Each image retries up to 3 attempts
  • Final output includes success count, failure count, and per-image failure reasons

Error Handling

  • Missing API key → error with setup instructions
  • 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
Codex image2 fallback

If --provider openai --model gpt-image-2.5-flare fails because OPENAI_API_KEY is missing but the current runtime has a native image-generation backend or the repo-level codex-imagegen wrapper is available, use that path rather than leaving the user waiting. Be explicit about whether the fallback is true reference-image generation or only a text-prompt reconstruction from extracted visual traits. See references/codex-image2-fallback.md.

References

FileContent
references/usage-examples.mdExtended CLI examples across providers and batch mode
references/codex-oauth-vs-openai-api-key.mdWhy Codex/ChatGPT OAuth image2 entitlement is not usable through baoyu-image-gen's standard OpenAI API-key provider
references/codex-image2-fallback.mdPractical fallback behavior when OpenAI API credentials are absent but Codex/native image generation is available
references/providers/dashscope.mdDashScope families, sizes, limits
references/providers/zai.mdZ.AI GLM-image / cogview-4
references/providers/minimax.mdMiniMax image-01 + subject reference
references/providers/openrouter.mdOpenRouter multimodal flow
references/providers/replicate.mdReplicate supported families + guardrails
references/providers/agnes.mdAgnes (agnes-image-2.5-flash) sizing, refs, and limits
references/config/preferences-schema.mdEXTEND.md schema
references/config/first-time-setup.mdFirst-time setup flow

Extension Support

Custom configurations via EXTEND.md. See Step 0 for paths and schema.

© JimLiu, 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 49 other files (scripts, references) in skills/baoyu-image-gen of JimLiu/baoyu-skills.

  • SKILL.md
  • references/codex-image2-fallback.md
  • references/codex-oauth-vs-openai-api-key.md
  • references/config/first-time-setup.md
  • references/config/preferences-schema.md
  • references/providers/agnes.md
  • references/providers/codex-cli.md
  • references/providers/dashscope.md
  • references/providers/minimax.md
  • references/providers/openrouter.md
  • references/providers/replicate.md
  • references/providers/zai.md
  • references/usage-examples.md
  • scripts/build-batch.test.ts
  • scripts/build-batch.ts
  • scripts/codex-imagegen/cache.ts
  • … and 34 more

Open the folder on GitHubat commit 1567581

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in JimLiu/baoyu-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Baoyu Image Gen 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.

Baoyu Image Gen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Baoyu Image Gen this skillJimLiu/baoyu-skills27k1 repos~5.3kAutomated safety check: NotesMIT
Baoyu Imagineguanyang/open-agent-hub977—~4.6kAutomated safety check: NotesMIT
Baoyu ImagineLeoYeAI/openclaw-master-skills2.2k—~5.1kAutomated safety check: NotesMIT
Media Toolstherichardngai-code/gpt-image-2-pro-max101—~1.5kAutomated safety check: NotesMIT
Image Genopen-octo/octo-agent125—~3.1kAutomated safety check: NotesMIT
9Router Image Generationdecolua/9router31k—~830Automated safety check: PassMIT

Similar skills

  • Baoyu Imagine

    guanyang/open-agent-hub

    AI image generation with OpenAI GPT Image 2, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image, MiniMax, Jimeng, Seedream and Replicate APIs.

    977 GitHub stars~4.6k tokensUpdated today
    Media & CreativeAuto-check: notes
  • Baoyu Imagine

    LeoYeAI/openclaw-master-skills

    AI image generation with OpenAI, Azure OpenAI, Google, OpenRouter, DashScope, MiniMax, Jimeng, Seedream and Replicate APIs.

    2.2k GitHub stars~5.1k tokensUpdated 2 mo ago
    Media & CreativeAuto-check: notes
  • Media Tools

    therichardngai-code/gpt-image-2-pro-max

    Two CLI tools for image generation + vision analysis using goclaw's provider-chain pattern.

    101 GitHub stars~1.5k tokensUpdated 4 mo ago
    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 yesterday
    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.

    31k GitHub stars~830 tokensUpdated 2 days ago
    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 3 days ago
    Media & CreativeAuto-check: notes

More from JimLiu/baoyu-skills

All 22 skills in this repo
  • Markdown Article Formatter

    JimLiu/baoyu-skills

    Reformats plain text or Markdown articles with frontmatter, a title, a summary, headings, bold, lists and code blocks, and saves a separate formatted copy.

    27k GitHub starsUsed in 6 repos~3.5k tokens
    Auto-check passed
  • X to Markdown Converter

    JimLiu/baoyu-skills

    Saves tweets, threads and X Articles as Markdown files with YAML front matter, using an unofficial API that asks for your consent first.

    27k GitHub starsUsed in 4 repos~1.8k tokens
    Auto-check: warnings
  • SVG Diagram Generator

    JimLiu/baoyu-skills

    Creates standalone dark-themed SVG diagrams, including architecture, flowchart, sequence, structural, mind map, timeline and state machine types.

    27k GitHub starsUsed in 1 repo~3.1k tokens
    Auto-check passed
  • Publishes articles and image-text posts to a WeChat Official Account through the API or Chrome CDP, converting markdown to WeChat-ready HTML with link citations.

    27k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check: warnings
  • Image Compressor

    JimLiu/baoyu-skills

    Compresses images to WebP by default, or to PNG or JPEG, picking the best available tool on the machine and optionally processing whole folders.

    27k GitHub starsUsed in 5 repos~598 tokens
    Auto-check passed
  • Generates text and images through an unofficial, reverse-engineered Gemini Web API, supporting reference images and multi-turn conversations.

    27k GitHub starsUsed in 5 repos~1.6k tokens
    Auto-check passed

Questions about Baoyu Image Gen

What does Baoyu Image Gen do?

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. Baoyu Image Gen is an agent skill from JimLiu/baoyu-skills.AI GLM-Image, MiniMax, Jimeng, Seedream, Replicate and Agnes APIs.

When should I use Baoyu Image Gen?

Baoyu Image Gen fits situations like: already has multiple prompts; wants stable multi-image throughput; user asks to generate.

How do I install Baoyu Image Gen in Claude Code?

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

How do I install Baoyu Image Gen in Codex?

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

Can I use Baoyu Image Gen 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 JimLiu/baoyu-skills --skill baoyu-image-gen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/baoyu-image-gen, .gemini/skills/baoyu-image-gen, .github/skills/baoyu-image-gen and .opencode/skills/baoyu-image-gen in your project.

What does Baoyu Image Gen need to run?

Going by SKILL.md and its folder, Baoyu Image Gen needs TypeScript for the scripts in its folder, the command-line tools its instructions call (codex, npx and brew) and credentials named OPENAI_API_KEY, AZURE_OPENAI_API_KEY, OPENROUTER_API_KEY and GOOGLE_API_KEY. Our summary lists: Node.js; A credential in OPENAI_API_KEY; A credential in AZURE_OPENAI_API_KEY.

Does Baoyu Image Gen access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Baoyu Image Gen safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. 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 Baoyu Image Gen use?

Baoyu Image Gen 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 Baoyu Image Gen use?

About 5.3k tokens (SKILL.md is roughly 21k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to Baoyu Image Gen?

Skills that share tags, products or a category with Baoyu Image Gen: Baoyu Imagine (guanyang/open-agent-hub, 977 stars), Baoyu Imagine (LeoYeAI/openclaw-master-skills, 2.2k stars), Media Tools (therichardngai-code/gpt-image-2-pro-max, 101 stars) and Image Gen (open-octo/octo-agent, 125 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Baoyu Image Gen?

JimLiu (a GitHub user) maintains it in JimLiu/baoyu-skills, which has 26,507 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on September 10, 2026.

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