見出し画像

Stable Diffusion web UIでベースとなるPromptとNegative Promptを簡単に調べる

概要

画像生成の初心者にとってプロンプトをどのように設計するかは難しい問題だ。そんな時に、もうすでに綺麗な画像を生成しているプロンプトを参考にすることはとても大事だ。今回は比較的簡単にプロンプトの参考例を抽出する方法を説明する。

方針

Stable Diffusionのモデルファイル(checkpoint)を共有するウェブサイトであるCivitai.comを活用する。このサイトでは、キレイな画像を生成している複数のプロンプト例が提示されている。このきれいな画像を生成しているプロンプトから共通するワードをピックアップする。そうすることで綺麗な画像を生成するために特に重要なプロンプトを見つける事ができる。
今回使用したモデル(checkpoint)は"Beautiful Realistic Asians”とした。

参考としたPrompt

特に綺麗に画像生成できていると個人的に判断したサイトの代表を以下に示す。

代表ページには、以下の様にPromptやNegative Promptが表示されている。

Prompt Negative Prompt例

これらのリンクをChatGPT(plugin機能)に読み込んでもらい共通する、Prompt、Negative Promptを抽出してもらった。使用したプラグインは、WebPilot。

plugin設定画面

ChatGPTに指示したプロンプトは以下。

以下参考サイトは、stable diffusionで画像生成する設定やpromptについての情報が記載されています。
また、以下参考サイトは、私が実際の写真に近い画像が生成されていると感じた物をピックアップしています。
ゴールを達成するため、#手順内のすべての##手順Nを実行してください。

#ゴール"""
実際の写真に近いきれいな画像を生成するために重要なpromptとnegative promptを把握する。
”””

#手順"""
##手順1:#参考サイトにあるすべてのページで、"prompt""negative prompt"を取得し、すべてを、"promptリスト""negative promptリスト"に格納してください。

##手順2"promptリスト""negative promptリスト"に格納されたプロンプトで意味的に共通するプロンプトのみ抽出し、それぞれ、"prompt共通リスト""negative prompt共通リスト"に格納してください。

##手順3"prompt共通リスト""negative prompt共通リスト"に格納されているプロンプトをカンマ(,)で区切って、それぞれ、"prompt最終リスト""negative prompt最終リスト"に格納してください。

##手順4"prompt最終リスト""negative prompt最終リスト"に格納されたプロンプトで#出力形式を守るように、修正し、結果を出力してください。
"""

#出力形式"""
promptとnegative promptでまとめて出力。
プロンプトは、コロン(,)で区切って表示してください。
表示例: 8k, RAW photo, (masterpiece:1.2), quality, 
英語で表示。
ゴールに重要なプロンプトのみ表示してください。
表情や夜景や年齢など特定のプロンプトは削除してください。
特定の年齢などに関係するプロンプトも削除してください。
"""

#参考サイト"""
<https://civitai.com/images/727365?period=AllTime&periodMode=published&sort=Most+Reactions&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=198335>
<https://civitai.com/images/715242?period=AllTime&periodMode=published&sort=Most+Reactions&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=195280>
<https://civitai.com/images/733353?period=AllTime&periodMode=published&sort=Most+Reactions&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=199897>
<https://civitai.com/images/907502?period=AllTime&periodMode=published&sort=Most+Reactions&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=241805>
<https://civitai.com/images/849303?period=AllTime&periodMode=published&sort=Most+Reactions&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=228060>
<https://civitai.com/images/995047?period=AllTime&periodMode=published&sort=Most+Comments&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=261888>
<https://civitai.com/images/714150?period=AllTime&periodMode=published&sort=Most+Comments&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=195042>
<https://civitai.com/images/850129?period=AllTime&periodMode=published&sort=Most+Comments&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=228287>
<https://civitai.com/images/848618?period=AllTime&periodMode=published&sort=Most+Comments&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=227898>
<https://civitai.com/images/998594?period=AllTime&periodMode=published&sort=Most+Comments&view=categories&excludeCrossPosts=true&modelVersionId=63786&modelId=25494&postId=262661>
"""

途中で回答が止まる事があるので、何回か”続けてください。”と指示した。

共通するPrompt

上記結果として出力されたプロンプトは以下。

  • Prompt

8k, RAW photo, best quality, (masterpiece:1.2), ultra detailed, ultra high res, realistic, (photo realistic:1.37), high detail RAW color photo, professional photograph, an extremely delicate and beautiful, extremely detailed, 8k wallpaper, Amazing, finely detail, huge file size, official art, extremely detailed CG unity 8k wallpaper, extremely detailed beautiful girl, extremely detailed face, extremely detailed eyes, extremely detailed skin, extremely detailed fingers, extremely detailed nose, extremely detailed mouth, perfect anatomy, highly detailed background, extremely detailed clothing, 1girl, cute girl, kawaii, realistic body, petite, fair skin, shiny skin, slender body, good figure, black hair, long straight hair, smile, cute, young, cute face, baby face, realistic face, beautifully detailed eyes, drooping eyes, beautiful big eyes, looking at viewer, outdoors,  public, crowd, dynamic lighting

Promptは、”kawaii”などきれいな画像を出す以外のワードも入っていたので手動で除外。

  • 修正Prompt

8k, RAW photo, best quality, (masterpiece:1.2), ultra detailed, ultra high res, realistic, (photo realistic:1.37), high detail RAW color photo, professional photograph, an extremely delicate and beautiful, extremely detailed, 8k wallpaper, Amazing, finely detail, huge file size, official art, extremely detailed CG unity 8k wallpaper,  extremely detailed face, extremely detailed eyes, extremely detailed skin, extremely detailed fingers, extremely detailed nose, extremely detailed mouth, perfect anatomy, highly detailed background, extremely detailed clothing,  realistic body,  shiny skin, good figure, realistic face, beautifully detailed eyes, dynamic lighting
  • Negarive Prompt

EasyNegative, (worst quality:2), (low quality:2), (normal quality:2), lowers, normal quality, (monochrome:1.2), (grayscale:1.2), skin spots, acnes, skin blemishes, age spot, ugly face, glans, fat, missing fingers, extra fingers, extra arms, extra legs, watermark, text, error, blurry, jpeg artifacts, cropped, bad anatomy, double navel, muscle, nsfw, nude, nipple, hair ornaments, cleavage

結果

今回は、”頭痛に悩む30代の女性”の画像を生成する。プロンプトは、英語で"(Woman in her 30s suffering from headaches:1.6)”とした。シードは、611853486。

  • 共通プロンプトあり

共通プロンプトあり生成画像
  • 共通プロンプトなし

共通プロンプトなし生成画像

共通プロンプトがあるとかなり綺麗に画像が生成できた。

まとめ

画像生成初心者がいきなりプロンプトを設計することはかなり難しい。しかし今すでにある完成度の高い画像を生成しているプロンプトを参考にして画像生成すると結構短時間でそれなりの画像を生成することができた。画像生成するプロンプトをChatGPTを用いて共通項を見いだすのはとにかく簡単であった。いろんなツールを組み合わせることがこれからどんどん大事になってくるではないかなと感じた。参考になれば幸いである。


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