見出し画像

【保存版】AI画像生成のガチャを終わらせる!YAML式の画像生成プロンプト!


〜初心者でもプロ並み画像が作れる!テンプレ付き〜


🎯この記事はこんな人におすすめ!

  • 画像生成AIを使ってみたけど、うまくいかない…

  • キャラは良いけど背景が毎回バラバラ…

  • プロンプトを毎回いちから考えるのがツラい…

  • 同じキャラで量産したいけど、やり方がわからない!

そんなあなたに贈る、プロンプト迷子を救う最強の構文
それが――
💥 YAML式プロンプトです!

こんにちは、にゃんと驚く発見をお届けするライターのNyantoです!
今日はAI画像生成でほぼほぼ全員が直面するであろう生成される画像のランダム性をかなりコントールしやすくなる方法についてご紹介したいと思います!


YAMLプロンプトってなに?

YAML(ヤムル)は、プログラミングの設定ファイルなどに使われる「人間にとって読みやすい」データ記述方式。
この書き方を画像生成AIの指示文に応用したのが、「YAML式プロンプト」です。

従来のプロンプト:

a cute cat, red background, pop art style

YAML式プロンプト:

character:
  species: cat
  color: black and white
background:
  color: red
style:
  - pop art
prompt: >
  A cute black and white cat on a red background in pop art style.

ポイントは、画像の要素をカテゴリ別に分けて整理できること!
だから頭の中もスッキリして、修正や再利用がとっても簡単になるんです。


YAML式の3大メリット

1. プロンプトの“設計図化”で迷わない!

頭の中にある「こんな画像が欲しい!」を、
・キャラクターの特徴
・背景の種類
・全体の雰囲気
…など要素ごとに分けて書けるから、画像生成AIの考えも整理される


2. 一度作れば量産できる!

テンプレートとして保存すれば、
・キャラの色だけ変える
・背景だけ変える
・ポーズだけ変える
といった部分変更が一瞬で可能!


3. 背景だけ差し替え → 雰囲気ガラッと変化!

キャラはそのままに、背景を「夏の海→冬の夜→ネオン街」などに変えられるから、
同一キャラで世界観だけ変えることもカンタン!


YAMLプロンプトの基本テンプレ【無料配布】

※以下は無料で画像生成が出来るimage FXで生成してみました

🐱キャラクター用


character:
  species: squirrel
  color: light brown and white
  eye_detail: large, sparkling eyes
  expression: surprised and happy
  pose: holding a sunflower seed with both hands
  mouth: open, joyful
style:
  - bold pop art
  - Japanese shonen manga style
  - simple composition suitable for stickers
prompt: >
  A cartoon squirrel character with large sparkling eyes, 
a joyful open-mouthed expression, and holding a sunflower seed with both hands. 
Illustrated in a bold pop-art and Japanese shonen manga style. No background. 
Designed to be used as a YouTube icon or sticker.


日本語版
キャラクター:
種類: リス
色: ライトブラウンと白
目の特徴: 大きくてキラキラした瞳
表情: 驚いていて嬉しそう
ポーズ: 両手でひまわりの種を持っている
口元: 開いていて楽しげ
スタイル:太めの線のポップアート風
日本の少年マンガ風 
ステッカー向きのシンプル構図
プロンプト: >
大きなキラキラした瞳をしたリスのキャラクター。
口を開けて楽しそうな表情で、両手でひまわりの種をもったポーズ。
ポップアートと日本の少年漫画風のイラスト。
背景なし。YouTubeアイコンやステッカーに適したデザイン。 

🏞背景用


scene:
  place: bamboo forest
  time: twilight
  season: summer
mood: mystical
style:
  - Japanese watercolor
prompt: >
  A mystical bamboo forest at twilight in Japanese watercolor style.
日本語版
シーン:
場所: 竹林
時間帯: 夕暮れ
季節: 夏
雰囲気: 神秘的
スタイル:日本の水彩画風
プロンプト: >
夏の夕暮れ時、竹林に広がる幻想的な風景。日本の伝統的な水彩画スタイルで描かれた静寂で神秘的な情景。

YAMLを使うとどう便利なの?

🎯 例:「さっきのリスのキャラクターの背景を変えたい」

YAMLなら「background」の部分を追加すればOKです!👇

character:
  species: squirrel
  color: light brown and white
  eye_detail: large, sparkling eyes
  expression: surprised and happy
  pose: holding a sunflower seed with both hands
  mouth: open, joyful
style:
  - bold pop art
  - Japanese shonen manga style
  - simple composition suitable for stickers
prompt: >
  A cartoon squirrel character with large sparkling eyes, 
a joyful open-mouthed expression, and holding a sunflower seed with both hands. 
Illustrated in a bold pop-art and Japanese shonen manga style. No background. 
Designed to be used as a YouTube icon or sticker.

character:
  species: squirrel
  color: light brown and white
  eye_detail: large, sparkling eyes
  expression: surprised and happy
  pose: holding a sunflower seed with both hands
  mouth: open, joyful
background:
  scene: forest
  time: morning
  lighting: soft sunlight streaming through the trees
  mood: peaceful and fresh
style:
  - bold pop art
  - Japanese shonen manga style
  - semi-realistic natural background
prompt: >
  A cartoon squirrel character with large sparkling eyes, 
a joyful open-mouthed expression, holding a sunflower seed with both hands, 
standing in a peaceful morning forest with soft sunlight streaming through the trees. 
Illustrated in a bold pop-art and Japanese shonen manga style, with a natural, semi-realistic background.

日本語版
キャラクター:
種類: リス
色: ライトブラウンと白
目の特徴: 大きくてキラキラした瞳
表情: 驚いていて嬉しそう
ポーズ: 両手でひまわりの種を持っている
口元: 開いていて楽しげ
背景:
シーン: 森の中
時間帯: 朝
光の演出: 木々の間からやさしく朝日が差し込む
雰囲気: 穏やかで爽やか
スタイル:太めの線のポップアート風
日本の少年マンガ風
背景は自然寄りのセミリアルタッチ
プロンプト: >
大きなキラキラした瞳をしたリスのキャラクター。口を開けて楽しそうな表情で、両手でひまわりの種を持っている。
やさしい朝日が木々の間から差し込む穏やかな森の中に立っている姿。ポップアート風と日本の少年マンガ風のテイストで、
自然なセミリアルな背景付きのイラスト。


これでまったく違う雰囲気の画像が生成可能!


よくある失敗とその対策

ありがち失敗 対策 情報を詰め込みすぎ 要素は3〜4個に絞る。テーマを明確に! 抽象的すぎる表現 「かわいい」ではなく「笑顔でほっぺが赤い」など具体化


画像→YAMLに変換する方法

AI画像を見て、「これ再現したい!」って思ったこと、ありますよね?
実は、画像からYAMLプロンプトを逆算して作ることも可能なんです!

ChatGPTで分析

ChatGPTに画像をアップしてこう聞くだけ:

この画像をYAMLプロンプト形式に分解して。

得られる結果例:

character:
  gender: female
  hairstyle: long straight hair
  hair_color: golden blonde
  eye_color: purple
  expression: calm and slightly serious
  clothing: black long-sleeve shirt
  accessories:
    - round black-rimmed glasses
  pose: touching her glasses while looking forward
background:
  color: soft beige (solid color)
  props:
    - wooden table
style:
  - anime-style
  - clean and simple
  - slice-of-life atmosphere
prompt: >
  A calm and slightly serious anime-style female character 
with long golden blonde hair and purple eyes.
She is wearing a black long-sleeve shirt and round black-rimmed glasses, 
gently touching her glasses while looking forward.
The background is a soft beige solid color with a wooden table visible in front. 
The illustration has a clean, slice-of-life anime aesthetic.
日本語版
キャラクター:
性別: 女性
髪型: ロングストレート
髪色: ゴールドブロンド
目の色: 紫
表情: 落ち着いていて、少し真剣
服装: 黒の長袖シャツ
小物: 黒縁の丸メガネ
ポーズ: メガネに手を添えてこちらを見つめている
背景:
色: 淡いベージュ(単色背景)
小道具: 木目のテーブル
スタイル:アニメ調
クリーンでシンプル
日常系
プロンプト: >
落ち着いた表情のアニメ風の女子キャラクター。ゴールドブロンドのロングヘアで、紫色の瞳。
黒いシャツを着て、黒縁の丸メガネをかけ、メガネに手を添えて静かにこちらを見ている。
背景はシンプルな淡いベージュで、木目のテーブルが写っている。
クリーンで整った日常系アニメスタイルの構図。

ものすごく細部まで具体的に表現してくれてますね!自分でここまで言語化するのはなかなか大変ですよね。画像解析ツールを使う方法など色々あるようですがChatGPTで十分だと思います。


✅まとめ:YAMLプロンプトは“創造力の拡張装置”

YAML式は、ただの書き方じゃありません。
それは、AIに「伝わる言葉」を作るための魔法のプロンプト

  • 再現性が高く

  • 修正が簡単で

  • 作りたいものを正確に指示できる

ChatGPTや画像生成AIと本気で向き合いたい人には、絶対におすすめの手法です!

いいなと思ったら応援しよう!