
Baoyu Image Gen
Wire multi-provider AI image generation (OpenAI, Google, Replicate, DashScope, and others) into agent workflows with aspect ratios, references, and batch prompt files.
Overview
baoyu-image-gen is an agent skill most often used in Build (also Launch, Grow) that generates images via multiple official AI APIs with batch and reference-image workflows.
Install
npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-image-genWhat is this skill?
- Official API paths for OpenAI, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image, MiniMax, Jimeng, Seedream, a
- Text-to-image, reference images, aspect ratios, and batch generation from saved prompt files
- Sequential default with optional batch parallel generation for multiple prompts
- User-input tool priority: AskUserQuestion-style tools first, numbered plain-text fallback
- Marked deprecated—maintainers direct new work to baoyu-imagine
- 10+ named API provider families in skill description
- Skill version 1.56.4 in frontmatter
Adoption & trust: 24.4k installs on skills.sh; 20.9k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need on-brand or product visuals from several AI providers but lack a single agent workflow for keys, prompts, and batch runs.
Who is it for?
Indie builders automating marketing tiles, app illustrations, or content pipelines who already use bun or npx and have API keys for listed providers.
Skip if: New projects—upstream deprecates this skill in favor of baoyu-imagine; also skip if you only need local SDXL without cloud APIs.
When should I use this skill?
User asks to generate, create, or draw images using supported AI image APIs.
What do I get? / Deliverables
Your agent can select a provider, collect inputs with a consistent questioning flow, and produce single or batched images from saved prompt files.
- Generated image assets
- Batch run from prompt files
- Provider-specific request configuration
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Image generation is usually integrated while building product features, landing assets, or in-app media—not only at launch. The skill is API orchestration and provider configuration, which fits integrations rather than pure frontend layout work.
Where it fits
Hook a SaaS admin panel to Replicate or OpenRouter for user-triggered image generation.
Produce hero and social sizes from one prompt file before a Product Hunt or newsletter push.
Run parallel batch generation for a week of blog header images from curated prompts.
How it compares
Agent skill for multi-vendor image APIs—not an MCP server and not a hosted gallery product by itself.
Common Questions / FAQ
Who is baoyu-image-gen for?
Solo developers and small teams using Claude Code or similar agents to generate or batch-produce images through commercial image APIs.
When should I use baoyu-image-gen?
While building in-app or CMS image features, creating launch creatives, or growing content volume—whenever the user asks to generate, create, or draw images via APIs.
Is baoyu-image-gen safe to install?
It requires network access and API keys; check the Security Audits panel on this page and rotate keys if you trial it in a shared environment.
Workflow Chain
Then invoke: baoyu imagine
SKILL.md
READMESKILL.md - Baoyu Image Gen
# Image Generation (AI SDK) Official API-based image generation. Supports OpenAI, Azure OpenAI, Google, OpenRouter, DashScope (阿里通义万象), Z.AI GLM-Image, MiniMax, Jimeng (即梦), Seedream (豆包) and Replicate. ## 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. Main script: `{baseDir}/scripts/main.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: | 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, 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. **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. ```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 # Batch mode ${BUN_X} {baseDir}/scripts/main.ts --batchfile batch.json --jobs 4 ``` ## 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 co