baoyu-image-gen
它能做什么
这项技能使用多种图片服务,根据文字描述创建图片。适合希望通过智能体获取图片的创作者,无论是一张还是多张。
适用场景
- ✓当你想根据文字提示词制作一张 AI 图片的时候。
- ✓当你保存了几组提示词,想要批量生成图片的时候。
- ✓当你想用参考图片来引导新图片的时候。
技能链接
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-image-gen/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请根据这段提示词生成一张冬天山间小屋的方形图片。”
每周 5 个新技能,1 分钟读完。
工作原理
你的智能体加载你的图片偏好设置,把提示词和任何参考图发送给所选服务商,并以你需要的宽高比保存结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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 4
Reference-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) |
| `--imag |
常见问题
它支持哪些服务商?
它支持许多图片服务,包括 OpenAI、Azure OpenAI、Google 和 OpenRouter 等。
我必须先设置偏好吗?
需要。该技能在生成任何内容之前,都需要你的偏好设置文件。
它能一次生成很多图片吗?
能。它可以根据保存的提示词文件运行批量任务,需要吞吐量时会并行处理。
详情
作者的原始描述
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.
repo: JimLiu/baoyu-skills
热度
- GitHub 星标
- 27k
- 排名
- #9957
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …