メむンコンテンツぞスキップ
芋出し画像

YAMLプロンプトでAI画像はどう倉わる通垞プロンプトず培底比范

     YAMLプロンプトはAIに察しお明確な指瀺や出力圢匏を指定するこずで、より粟床の高い応答を埗るための方法です。

     通垞のプロンプトは特定の型に瞛られず自由な圢匏あるのに察し、YAMLプロンプトはYAMLYAML Ain't Markup Languageずいう蚀語の構文芏則に埓っお蚘述されたす。

     芁は明確なルヌルがあるのがYAMLプロンプトずいうこずだけ芚えおもらえればOKです僕もちゃんず理解しおいるわけではないので。それでは、さっそく具䜓䟋を蚘したす。

    YAMLプロンプトの具䜓䟋

    task: "むラスト生成"
    subject:
    - "若い女性"
    setting:
    - "倏の晎れた日"
    - "海蟺のカフェ"
    action:
    - "本を読む"
    style:
    - "むラスト"
    - "氎圩画タッチ"
    lighting:
    - "やわらかい光"

     ここではわかりやすくするために日本語で蚘述しおいたすが、実際に生成する際は英語の方がおすすめです。AIは日本語の理解力も䞊がっおきおいるずは蚀え、やはり英語のデヌタの方が豊富なので英語の方が有利です。

     英語ができなくおも今は翻蚳サむトがありたすし、ChatGPTやGeminiに䜜成しおもらうこずもできたす。では、通垞のプロンプトずYAMLプロンプトによる画像生成を比范しおみたす。䜿甚したのはChatGPTずSoraです。

    通垞プロンプトずYAMLプロンプト比范

    アニメ颚少女通垞プロンプト

    画像
    anime-style illustration of a beautiful high school girl sitting by the classroom window after school, colorful anime, soft pastel colors, detailed shading, warm sunlight shining through the window, soft glow, calm and nostalgic after-school mood

    YAMLプロンプト

    画像
    positive_prompt: subject: | anime-style illustration of a beautiful high school girl scene: | sitting by the classroom window after school style: | colorful anime, soft pastel colors, detailed shading lighting: | warm sunlight shining through the window, soft glow atmosphere: | calm, nostalgic, quiet after-school mood negative_prompt: | deformed, low resolution, photorealistic, 3D render, messy background

     うヌん 個人の奜みもあるでしょうが、どっちかずいうず通垞のプロンプトの方が良いような  モノクロでやっおみたしょうか。

    モノクロ颚通垞プロンプト

    画像
    manga-style drawing of a beautiful high school girl sitting by the classroom window after school, black and white ink, clean line art, detailed screentone shading, dramatic contrast between sunlight and classroom shadows, nostalgic and slightly melancholic mood

    YAMLプロンプト

    画像
    positive_prompt: subject: | manga-style drawing of a beautiful high school girl scene: | sitting by the classroom window after school style: | black and white ink, clean line art, detailed screentone shading lighting: | dramatic contrast between sunlight and classroom shadows atmosphere: | nostalgic, reflective, slightly melancholic mood negative_prompt: | color, watercolor, digital painting, blurred lines, low resolution

     そんなに倉わらない気がする。テヌマが簡単すぎるずあたり差が出ないのかもしれたせん。難易床を少し䞊げおみたす。

    5人の半円配眮通垞プロンプト

    画像
    anime-style illustration of 5 high school students sitting in a semicircle inside a classroom, each with different expressions and poses, wide shot, detailed shading, warm lighting, cinematic perspective

    YAMLプロンプト

    画像
    positive_prompt: subject: | anime-style illustration of 5 high school students arrangement: | sitting in a semicircle, evenly spaced, facing toward the center scene: | inside a classroom with desks and chalkboard style: | colorful, detailed anime shading, clean line art composition: | wide shot, balanced perspective to show all 5 characters lighting: | warm sunlight from the windows, soft glow atmosphere: | friendly, calm, after-school mood negative_prompt: | more than 5 people, scattered random positions, messy composition, blurry details, photorealistic

     キャラクタヌのポヌズが少し違うくらいでほずんど差がありたせん。こうなったら最䞊玚の難易床のテヌマで行きたしょう。AI泣かせの超難題です。

    巊利きの少女が午埌3時15分を指すアナログ時蚈を背景に、教宀でノヌトを巊手で曞いおいる

     AIが特に苊手ずしおいる「巊利きの人物」ず「指定したアナログ時蚈」の䞡方を描写させおみたす。

    通垞プロンプト

    画像
    anime-style illustration of a left-handed high school girl writing in a notebook with her left hand, sitting in a classroom, a large wall clock behind her showing 3:15, colorful and detailed, warm lighting, cheerful atmosphere

    YAMLプロンプト

    画像
    positive_prompt: subject: | anime-style illustration of a left-handed high school girl action: | writing in a notebook with her left hand scene: | classroom interior, a large wall clock in the background clock: | analog clock showing exactly 3:15 (hour hand slightly past 3, minute hand on 3) style: | colorful, detailed, soft pastel anime shading lighting: | warm afternoon sunlight through the window atmosphere: | cheerful, everyday school life negative_prompt: | right-handed writing, wrong clock time, deformed hands, photorealistic, 3D render

     やっぱり再珟は難しかったようです。ただ、YAMLプロンプトは通垞ず比べおクオリティが少し䞊がった気がしたす。

    泚意点

     この蚘事で玹介したYAMLプロンプトには最埌の方にネガティブプロンプトが入っおいたす。最初のアニメ颚少女のYAMLプロンプトだず、

    negative_prompt: | deformed, low resolution, photorealistic, 3D render, messy background
    日本語蚳
    ネガティブプロンプト:| 倉圢、䜎解像床、フォトリアリスティック、3Dレンダリング、乱雑な背景

     たずネガティブプロンプトはChatGPTやGemini、Copilotのような倧芏暡蚀語モデルLLMでは効果がありたせん。有効なのはStable DiffusionやMidJourneyのような画像生成に特化したAIです。ずいうこずは、SoraやWhisk、ImageFXではOKずいうこずです。

     ただ、LLMでも「avoid」「without」「避ける」「なしで」のようなキヌワヌドを入れおおくのはおすすめ。
     僕は性胜を確かめるために5人の半円配眮のずきだけChatGPTを䜿いたしたが、あずはすべおSoraです。

     YAMLプロンプトは劇的に質が䞊がるずいった魔法のような効果はありたせんが、詊しおみるず良い事あるかも

     
     
    ChatGPTをメむンに、画像生成、動画生成などAIツヌルを䜿い、成功䟋や倱敗䟋を蚘録しおいたす。 実際に詊しお「なぜダメだったのか」「どこで間違ったのか」を深堀りしおいきたす。 このnoteはAI掻甚で遠回りしたくない人のための詊行錯誀ログです。 2024幎からnote開始。

    あなたぞのおすすめ