baoyu-image-gen
OpenAIとGoogleのAPIを活用し、テキストから画像を生成したり、参考画像を指定したり、アスペクト比を調整したりできる、ビジネスシーンで求められる様々な画像生成ニーズに応えるSkill。
📜 元の英語説明(参考)
AI image generation with OpenAI and Google APIs. Supports text-to-image, reference images, aspect ratios, and parallel generation (recommended 4 concurrent subagents). Use when user asks to generate, create, or draw images.
🇯🇵 日本人クリエイター向け解説
OpenAIとGoogleのAPIを活用し、テキストから画像を生成したり、参考画像を指定したり、アスペクト比を調整したりできる、ビジネスシーンで求められる様々な画像生成ニーズに応えるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o baoyu-image-gen.zip https://jpskill.com/download/19388.zip && unzip -o baoyu-image-gen.zip && rm baoyu-image-gen.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19388.zip -OutFile "$d\baoyu-image-gen.zip"; Expand-Archive "$d\baoyu-image-gen.zip" -DestinationPath $d -Force; ri "$d\baoyu-image-gen.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
baoyu-image-gen.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
baoyu-image-genフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 5
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
画像生成 (AI SDK)
公式APIベースの画像生成です。OpenAIとGoogleプロバイダーをサポートしています。
スクリプトディレクトリ
エージェントの実行:
SKILL_DIR= このSKILL.mdファイルがあるディレクトリ- スクリプトパス =
${SKILL_DIR}/scripts/main.ts
設定 (EXTEND.md)
Bashを使用してEXTEND.mdの存在を確認します(優先順位):
# まずプロジェクトレベルを確認
test -f .baoyu-skills/baoyu-image-gen/EXTEND.md && echo "project"
# 次にユーザーレベル(クロスプラットフォーム: $HOMEはmacOS/Linux/WSLで動作)
test -f "$HOME/.baoyu-skills/baoyu-image-gen/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────┬───────────────────┐ │ パス │ 場所 │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-image-gen/EXTEND.md │ プロジェクトディレクトリ │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-image-gen/EXTEND.md │ ユーザーホーム │ └──────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 結果 │ アクション │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 見つかった │ 設定を読み込み、解析し、適用する │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 見つからない │ デフォルトを使用する │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.mdがサポートするもの: デフォルトプロバイダー | デフォルト品質 | デフォルトアスペクト比
使用方法
# 基本
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image cat.png
# アスペクト比を指定
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A landscape" --image out.png --ar 16:9
# 高品質
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --quality 2k
# プロンプトファイルから
npx -y bun ${SKILL_DIR}/scripts/main.ts --promptfiles system.md content.md --image out.png
# 参照画像付き (Googleマルチモーダルのみ)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Make blue" --image out.png --ref source.png
# 特定のプロバイダー
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --provider openai
オプション
| オプション | 説明 |
|---|---|
--prompt <text>, -p |
プロンプトテキスト |
--promptfiles <files...> |
ファイルからプロンプトを読み込む(連結されます) |
--image <path> |
出力画像パス(必須) |
--provider google\|openai |
プロバイダーを強制する(デフォルト: google) |
--model <id>, -m |
モデルID |
--ar <ratio> |
アスペクト比(例: 16:9, 1:1, 4:3) |
--size <WxH> |
サイズ(例: 1024x1024) |
--quality normal\|2k |
品質プリセット(デフォルト: 2k) |
--imageSize 1K\|2K\|4K |
Googleの画像サイズ(デフォルト: 品質から) |
--ref <files...> |
参照画像(Googleマルチモーダルのみ) |
--n <count> |
画像の数 |
--json |
JSON出力 |
環境変数
| 変数 | 説明 |
|---|---|
OPENAI_API_KEY |
OpenAI APIキー |
GOOGLE_API_KEY |
Google APIキー |
OPENAI_IMAGE_MODEL |
OpenAIモデルのオーバーライド |
GOOGLE_IMAGE_MODEL |
Googleモデルのオーバーライド |
OPENAI_BASE_URL |
カスタムOpenAIエンドポイント |
GOOGLE_BASE_URL |
カスタムGoogleエンドポイント |
読み込み優先順位: CLI引数 > 環境変数 > <cwd>/.baoyu-skills/.env > ~/.baoyu-skills/.env
プロバイダーの選択
--providerが指定されている場合 → それを使用します- 利用可能なAPIキーが1つだけの場合 → そのプロバイダーを使用します
- 両方利用可能な場合 → デフォルトでGoogleを使用します
品質プリセット
| プリセット | Google imageSize | OpenAI Size | ユースケース |
|---|---|---|---|
normal |
1K | 1024px | クイックプレビュー |
2k (デフォルト) |
2K | 2048px | カバー、イラスト、インフォグラフィック |
Google imageSize: --imageSize 1K|2K|4Kでオーバーライドできます。
アスペクト比
サポートされているもの: 1:1, 16:9, 9:16, 4:3, 3:4, 2.35:1
- Googleマルチモーダル:
imageConfig.aspectRatioを使用します - Google Imagen:
aspectRatioパラメーターを使用します - OpenAI: 最も近いサポートされているサイズにマッピングされます
並列生成
バッチ操作のために、バックグラウンドサブエージェントを介した同時画像生成をサポートしています。
| 設定 | 値 |
|---|---|
| 推奨される並行処理数 | 4サブエージェント |
| 最大並行処理数 | 8サブエージェント |
| ユースケース | バッチ生成(スライド、コミック、インフォグラフィック) |
エージェントの実装:
# Taskツールを使用して複数の生成を並行して起動
# 各Taskはrun_in_background=trueでバックグラウンドサブエージェントとして実行
# 全て完了したらTaskOutputを介して結果を収集
ベストプラクティス: 4枚以上の画像を生成する場合、逐次実行ではなく、バックグラウンドサブエージェントを起動することをお勧めします(推奨は4並行)。
エラー処理
- APIキーが見つからない場合 → セットアップ手順を含むエラー
- 生成失敗 → 1回自動再試行
- 無効なアスペクト比 → 警告、デフォルトで続行
- マルチモーダルではないモデルでの参照画像 → 警告、参照は無視
拡張機能のサポート
EXTEND.mdを介したカスタム設定。パスとサポートされているオプションについては、「設定」セクションを参照してください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Image Generation (AI SDK)
Official API-based image generation. Supports OpenAI and Google providers.
Script Directory
Agent Execution:
SKILL_DIR= this SKILL.md file's directory- Script path =
${SKILL_DIR}/scripts/main.ts
Preferences (EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .baoyu-skills/baoyu-image-gen/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-image-gen/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-image-gen/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-image-gen/EXTEND.md │ User home │ └──────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports: Default provider | Default quality | Default aspect ratio
Usage
# Basic
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image cat.png
# With aspect ratio
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A landscape" --image out.png --ar 16:9
# High quality
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --quality 2k
# From prompt files
npx -y bun ${SKILL_DIR}/scripts/main.ts --promptfiles system.md content.md --image out.png
# With reference images (Google multimodal only)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Make blue" --image out.png --ref source.png
# Specific provider
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --provider openai
Options
| Option | Description |
|---|---|
--prompt <text>, -p |
Prompt text |
--promptfiles <files...> |
Read prompt from files (concatenated) |
--image <path> |
Output image path (required) |
--provider google\|openai |
Force provider (default: google) |
--model <id>, -m |
Model ID |
--ar <ratio> |
Aspect ratio (e.g., 16:9, 1:1, 4:3) |
--size <WxH> |
Size (e.g., 1024x1024) |
--quality normal\|2k |
Quality preset (default: 2k) |
--imageSize 1K\|2K\|4K |
Image size for Google (default: from quality) |
--ref <files...> |
Reference images (Google multimodal only) |
--n <count> |
Number of images |
--json |
JSON output |
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key |
GOOGLE_API_KEY |
Google API key |
OPENAI_IMAGE_MODEL |
OpenAI model override |
GOOGLE_IMAGE_MODEL |
Google model override |
OPENAI_BASE_URL |
Custom OpenAI endpoint |
GOOGLE_BASE_URL |
Custom Google endpoint |
Load Priority: CLI args > env vars > <cwd>/.baoyu-skills/.env > ~/.baoyu-skills/.env
Provider Selection
--providerspecified → use it- Only one API key available → use that provider
- Both available → default to Google
Quality Presets
| Preset | Google imageSize | OpenAI Size | Use Case |
|---|---|---|---|
normal |
1K | 1024px | Quick previews |
2k (default) |
2K | 2048px | Covers, illustrations, infographics |
Google imageSize: Can be overridden with --imageSize 1K|2K|4K
Aspect Ratios
Supported: 1:1, 16:9, 9:16, 4:3, 3:4, 2.35:1
- Google multimodal: uses
imageConfig.aspectRatio - Google Imagen: uses
aspectRatioparameter - OpenAI: maps to closest supported size
Parallel Generation
Supports concurrent image generation via background subagents for batch operations.
| Setting | Value |
|---|---|
| Recommended concurrency | 4 subagents |
| Max concurrency | 8 subagents |
| Use case | Batch generation (slides, comics, infographics) |
Agent Implementation:
# Launch multiple generations in parallel using Task tool
# Each Task runs as background subagent with run_in_background=true
# Collect results via TaskOutput when all complete
Best Practice: When generating 4+ images, spawn background subagents (recommended 4 concurrent) instead of sequential execution.
Error Handling
- Missing API key → error with setup instructions
- Generation failure → auto-retry once
- Invalid aspect ratio → warning, proceed with default
- Reference images with non-multimodal model → warning, ignore refs
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (6,905 bytes)
- 📎 scripts/main.ts (9,453 bytes)
- 📎 scripts/providers/google.ts (7,346 bytes)
- 📎 scripts/providers/openai.ts (2,864 bytes)
- 📎 scripts/types.ts (419 bytes)