# /baoyu-image-gen: One image generation backend across many AI providers

Source: https://trendhub.net/skills/jimliu-baoyu-skills/baoyu-image-gen
Skill folder: https://github.com/JimLiu/baoyu-skills/tree/main/skills/baoyu-image-gen
Pack: Baoyu Skills (https://trendhub.net/skills/jimliu-baoyu-skills)
Works with: Any agent (npx skills), Claude Code, ClawHub / OpenClaw

This is the shared image engine the other skills can call. It wraps OpenAI, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI, MiniMax, Jimeng, Seedream, Replicate, Agnes and a Codex CLI route behind one script, with saved defaults, reference images, aspect ratios and a batch mode with throttling and retries for many prompts at once.

## When to use it

- You want to try the same prompt on different image providers without new code.
- Another skill has produced a folder of prompt files that need rendering in bulk.
- You must keep a real person or product consistent across several generated images.

## How it works

1. **Load preferences first**: It will not generate until EXTEND.md exists, running a setup that asks for provider, model, quality and save location.
2. **Resolve provider and model**: It takes the CLI flag, then EXTEND.md, then environment variables, then built-in defaults, and shows which provider and model it is using.
3. **Handle references carefully**: For identity-preserving edits it uses short, firm identity wording and two to four curated source images rather than long feature descriptions.
4. **Choose single or batch**: It generates one or two images sequentially, and switches to a batch file with worker limits once prompt files already exist.
5. **Retry and report**: Each image gets up to three attempts, and the run ends with success and failure counts and reasons.

## What it steers the agent away from

- Pasting a Codex or ChatGPT login token into OPENAI_API_KEY.
- Using freshly generated outputs as references, which makes identity drift worse.
- Spawning subagents just to parallelise rendering when a batch file will do.

## What it can touch

It runs bundled bun scripts, reads provider API keys from the environment or .baoyu-skills/.env files, sends prompts and reference images to the chosen provider and writes image files.

## Pairs well with

- `/baoyu-article-illustrator`
- `/baoyu-cover-image`
- `/baoyu-slide-deck`

## Questions

### Can I use it without an OpenAI API key?

Yes. Any supported provider key works, and with the codex CLI logged in you can pin the codex-cli provider to use a Codex subscription instead.

### Which aspect ratios are supported?

Six ratios are listed, from square and 4:3 through widescreen 16:9, portrait 9:16 and 3:4 to cinematic 2.35:1, each mapped to the provider's own size or ratio setting.
