画像生成スキル は何をしますか?
概要
このスキルは、構造化されたプロンプトとPythonスクリプトを使用して高品質な画像を生成します。ワークフローには、JSON形式のプロンプトの作成と、オプションの参照画像を使用した画像生成の実行が含まれます。
コア機能
- AIGC画像生成のための構造化JSONプロンプトを作成
- スタイル/構図ガイダンスのための複数参照画像をサポート
- 自動化されたPythonスクリプト実行による画像生成
- さまざまな画像生成シナリオ(キャラクターデザイン、シーン、製品など)を処理
ワークフロー
ステップ1: 要件の理解
ユーザーが画像生成をリクエストした場合、以下を特定します:
- 被写体/コンテンツ: 画像に何を含めるか
- スタイルの好み: アートスタイル、雰囲気、カラーパレット
- 技術仕様: アスペクト比、構図、照明
- 参照画像: 生成をガイドするための画像
/mnt/user-data下のフォルダを確認する必要はありません
ステップ2: 構造化プロンプトの作成
/mnt/user-data/workspace/ に命名パターン {descriptive-name}.json で構造化JSONファイルを生成します。
ステップ3: 生成の実行
Pythonスクリプトを呼び出します:
python /mnt/skills/public/image-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/prompt-file.json \
--reference-images /path/to/ref1.jpg /path/to/ref2.png \
--output-file /mnt/user-data/outputs/generated-image.jpg \
--aspect-ratio 16:9
パラメータ:
--prompt-file: JSONプロンプトファイルへの絶対パス(必須)--reference-images: 参照画像への絶対パス(オプション、スペース区切り)--output-file: 出力画像ファイルへの絶対パス(必須)--aspect-ratio: 生成画像のアスペクト比(オプション、デフォルト: 16:9)
[!NOTE] pythonファイルは読み込まず、パラメータを指定して呼び出すだけにしてください。
キャラクター生成の例
ユーザーリクエスト: 「1990年代の東京ストリートスタイルの女性キャラクターを作成してください」
プロンプトファイルを作成: /mnt/user-data/workspace/asian-woman.json
{
"characters": [{
"gender": "female",
"age": "mid-20s",
"ethnicity": "Japanese",
"body_type": "slender, elegant",
"facial_features": "delicate features, expressive eyes, subtle makeup with emphasis on lips, long dark hair partially wet from rain",
"clothing": "stylish trench coat, designer handbag, high heels, contemporary Tokyo street fashion",
"accessories": "minimal jewelry, statement earrings, leather handbag",
"era": "1990s"
}],
"negative_prompt": "blurry face, deformed, low quality, overly sharp digital look, oversaturated colors, artificial lighting, studio setting, posed, selfie angle",
"style": "Leica M11 street photography aesthetic, film-like rendering, natural color palette with slight warmth, bokeh background blur, analog photography feel",
"composition": "medium shot, rule of thirds, subject slightly off-center, environmental context of Tokyo street visible, shallow depth of field isolating subject",
"lighting": "neon lights from signs and storefronts, wet pavement reflections, soft ambient city glow, natural street lighting, rim lighting from background neons",
"color_palette": "muted naturalistic tones, warm skin tones, cool blue and magenta neon accents, desaturated compared to digital photography, film grain texture"
}
生成を実行:
python /mnt/skills/public/image-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/cyberpunk-hacker.json \
--output-file /mnt/user-data/outputs/cyberpunk-hacker-01.jpg \
--aspect-ratio 2:3
参照画像を使用する場合:
{
"characters": [{
"gender": "based on [Image 1]",
"age": "based on [Image 1]",
"ethnicity": "human from [Image 1] adapted to Star Wars universe",
"body_type": "based on [Image 1]",
"facial_features": "matching [Image 1] with slight weathered look from space travel",
"clothing": "Star Wars style outfit - worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with holster",
"accessories": "blaster pistol on hip, comlink device on wrist, goggles pushed up on forehead, satchel with supplies, personal vehicle based on [Image 2]",
"era": "Star Wars universe, post-Empire era"
}],
"prompt": "Character inspired by [Image 1] standing next to a vehicle inspired by [Image 2] on a bustling alien planet street in Star Wars universe aesthetic. Character wearing worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with blaster holster. The vehicle adapted to Star Wars aesthetic with weathered metal panels, repulsor engines, desert dust covering, parked on the street. Exotic alien marketplace street with multi-level architecture, weathered metal structures, hanging market stalls with colorful awnings, alien species walking by as background characters. Twin suns casting warm golden light, atmospheric dust particles in air, moisture vaporators visible in distance. Gritty lived-in Star Wars aesthetic, practical effects look, film grain texture, cinematic composition.",
"negative_prompt": "clean futuristic look, sterile environment, overly CGI appearance, fantasy medieval elements, Earth architecture, modern city",
"style": "Star Wars original trilogy aesthetic, lived-in universe, practical effects inspired, cinematic film look, slightly desaturated with warm tones",
"composition": "medium wide shot, character in foreground with alien street extending into background, environmental storytelling, rule of thirds",
"lighting": "warm golden hour lighting from twin suns, rim lighting on character, atmospheric haze, practical light sources from market stalls",
"color_palette": "warm sandy tones, ochre and sienna, dusty blues, weathered metals, muted earth colors with pops of alien market colors",
"technical": {
"aspect_ratio": "9:16",
"quality": "high",
"detail_level": "highly detailed with film-like texture"
}
}
python /mnt/skills/public/image-generation/scripts/generate.py \
--prompt-file /mnt/user-data/workspace/star-wars-scene.json \
--reference-images /mnt/user-data/uploads/character-ref.jpg /mnt/user-data/uploads/vehicle-ref.jpg \
--output-file /mnt/user-data/outputs/star-wars-scene-01.jpg \
--aspect-ratio 16:9
一般的なシナリオ
シナリオに応じて異なるJSONスキーマを使用します。
キャラクターデザイン:
- 身体的特徴(性別、年齢、民族、体型)
- 顔の特徴と表情
- 服装とアクセサリー
- 歴史的な時代または設定
- ポーズとコンテキスト
シーン生成:
- 環境の説明
- 時間帯、天候
- 雰囲気とムード
- 焦点と構図
商品ビジュアライゼーション:
- 製品の詳細と素材
- 照明設定
- 背景とコンテキスト
- プレゼンテーションの角度
特定のテンプレート
以下のテンプレートファイルは、ユーザーリクエストに一致する場合にのみ読み取ってください。
出力処理
生成後:
- 画像は通常
/mnt/user-data/outputs/に保存されます present_filesツールを使用して生成画像をユーザーと共有- 生成結果の簡単な説明を提供
- 調整が必要な場合は反復処理を提案
ヒント: 参照画像による生成の強化
視覚的な精度が重要なシナリオでは、生成前にまず image_search ツールを使用 して参照画像を見つけてください。
image_search ツールの推奨シナリオ:
- キャラクター/ポートレート生成: 顔の特徴や体型をガイドするために、類似のポーズ、表情、スタイルを検索
- 特定のオブジェクトや製品: 正確な表現を確保するために実際のオブジェクトの参照画像を検索
- 建築物や環境シーン: 本格的なディテールを捉えるために場所の参照を検索
- ファッションと衣服: 正確な衣服のディテールとスタイリングを確保するためにスタイル参照を検索
ワークフロー例:
image_searchツールを呼び出して適切な参照画像を見つける:image_search(query="Japanese woman street photography 1990s", size="Large")- 返された画像URLをローカルファイルにダウンロード
- ダウンロードした画像を生成スクリプトの
--reference-imagesパラメータとして使用
このアプローチにより、テキスト記述のみに頼るのではなく、具体的なビジュアルガイダンスをモデルに提供することで、生成品質が大幅に向上します。
プロバイダー (Gemini / MiniMax)
このスキルは、環境変数によってプロバイダーを自動選択します(CLIの変更は不要):
GEMINI_API_KEYが設定されている → Gemini を使用(デフォルト、変更なし)MINIMAX_API_KEYのみ設定されている → MiniMax を使用(/v1/image_generation、モデルimage-01)IMAGE_GENERATION_PROVIDER=gemini|minimaxで明示的に強制
MiniMax のオプションオーバーライド: MINIMAX_API_HOST(デフォルト https://api.minimaxi.com)、
MINIMAX_IMAGE_MODEL(デフォルト image-01)。参照画像は MiniMax の subject_reference キャラクター画像として送信されます。CLI と --prompt-file / --reference-images / --output-file / --aspect-ratio 引数は両方のプロバイダーで同一です。
MiniMax のプロンプト処理(プロバイダー内部)。 オーサリングはプロバイダーに依存しません — アクティブなプロバイダーに関係なく同じ構造化JSONを記述します。MiniMax image-01 は単一のテキスト文字列を消費するため、MiniMax パス自体はJSONの prompt フィールドのみを送信し(style / composition / negative_prompt などの他のフィールドは Gemini パスに適用されます)、prompt_optimizer を有効にして MiniMax がサーバー側で拡張できるようにします。MiniMax はそのプロンプトを1500文字に制限します。prompt フィールドがそれより長い場合、スクリプトはAPIを呼び出さずにエラーを返します。Gemini パスは完全な構造化JSONを受け取ります。
注意事項
- ユーザーの言語に関係なく、プロンプトは常に英語を使用
- JSON形式により、構造化された解析可能なプロンプトが保証されます
- 参照画像は生成品質を大幅に向上させます
- 最適な結果を得るためには、反復的な調整が一般的です
- キャラクター生成の場合は、詳細なキャラクターオブジェクトと統合プロンプトフィールドを含めてください