Stable Diffusionに美少女を描いてもらうためのヒント

はじめに

この記事は、AIについて技術的なことは何も分からないド文系の素人により作成されています。しかし、「どういう設定で、どういうプロンプトを使うと、どういう絵が描けた」というのは事実としてお伝えできます。この記事はそれをベースとして、自分なりの考察を加え、主にプロンプトについて皆さんにヒントを提供できたら良いな、という意図で書かれています。初心者向け、といったところでしょうか。
この記事が皆さんのプロンプトエンジニアリングのお役に立てることを願っております。
※私も断然未熟なので、コメントやtwitterの方でのご指摘もどうぞよろしくお願いいたします。適宜記事の加筆・修正もして参ります。
twitterのURL: https://twitter.com/jonjimisaki

プロンプトの基本

基本的に「全体の構図の指示→部位・細部の指示→全体的な仕上げ・クオリティ向上の指示」の順で書くとよい

「はじめに」でも述べた通り技術的なことは全く分からないんですが、恐らく単語を一個ずつ拾い、拾うたびにその単語に従って画像を変化させる、という感じで動作しているんじゃないでしょうか。しかも、その単語で指示されたこと以外は完全に「なんとなく」で描いてしまう(この「なんとなく」はバイアス(先入観)って呼ばれてるんでしたっけ?そもそもAIはバイアスを描いている、なんて言われてるのを聞いたことがあったような気が)。そしてもしそうなら、例えばあるモデルでwoman, の「なんとなく」に「人間の全身像」が入っているとすると、最初の段階では画面の真ん中に縦の一本の棒みたいなものを描いてしまうかもしれません。そしてその単語以降はそれを変化させながら絵を描いていくことになります。しかし、例えば寝ている女性を描きたかった場合はその「なんとなく」は邪魔になってしまいます。その分画像の大まかな構図の完成ができず思い通りの絵にならなかったり、完成が遅い段階になって細部の仕上げが進まなかったりしてしまいます。最初にはっきりと構図を指定しておくのは奇形防止・クオリティ向上に役立つと思います。故に、プロンプトの全体の構造は「構造の指示→部位・細部の指示→全体的な仕上げ・クオリティ向上の指示」の順が良いと思われます。さっきの例だと「寝ている女性」を最初の方で指示すると良さそうですね。

構図の指示

私は人物メインの画像しか描いてもらったことが無いので、景色の描写とかは全く詳しくありません…現時点で分かっていることを記します。

  • 人物のポーズをはっきりさせておくと奇形防止に繋がると思います。

  • 対象に近づきたいときはclose up, を用います。

  • 遠近はsmall, やbig, など、大きい・小さいで表現するのも良いと思います。

  • ピクセル数だと引きで見た時の画面になりがちです。顔のどアップなんかは高ピクセル数だと出にくいです。顔のアップを高ピクセル数で出したいときはHires.fixを使います。Denoising strengthは小さければ小さいほど、低ピクセルで出した画像に忠実になります。低ピクセル数で出した構図をそのまま使いたいなら低めに設定するのが良いと思います。

  • プロンプトの最初の方で指定するだけでは構図が言う通りにならない場合もあります。そんなときは、構図の大事なところを簡潔にプロンプトの真ん中辺りとか最後辺りとか、てきとーな所に何箇所か入れてみましょう。

  • ここで色をしっかり指定しておくのも大事です。

部位・細部の指示

構図のところで指示したものに大きな変更を加えないような指示が良いです。上でも言った通り、人物のポーズなどは構図のところで行うとよいと思います。基本的には、
good, well-shaped, graphic, beautiful, highly detailed, 
などの単語を使うといい感じになります。目であれば、
good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, 
など全部使ってもよいかもしれません。
beautifulは形ではなく、どちらかというと色合いの指定になる気がします。

全体的な仕上げ・クオリティ向上の指示

これに関しては、検証は絵に詳しくないと難しいですよね。多分あった方がいいんだろうけど、効果の検証は難しい…って感じで、「お守り」なんて呼ばれることもあります。そして上でも述べたように、プロンプトの最初の方で構図の指示がしっかりできていることを前提としています。ここでは、私が普段使っているプロンプトを紹介して説明に代えさせていただきます。コメントなどで皆さんのも教えていただけると嬉しいです。プロンプト全体の最後の方に以下の全てを入れています。2、3回繰り返したりもします。また、クオリティの向上以外の細かい指示があればそれもこの段階で書きます。全体の構図を大きく影響を与えるようなものは含めない方が良いと思います。
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, beautiful hair, highly detailed hair, (((highly detailed))), 

ネガティブプロンプト

ネガティブプロンプトには二種類に分けて考えています。「クオリティに関するもの」と「それ以外」です。また、ネガティブプロンプトでの単語の順に関する検証・考察は現時点であまり進んでおりません。「出て欲しくない順」くらいでしょうか。一応「クオリティに関するもの」は普通のプロンプトと同様、ネガティブプロンプトの中の後ろの方に配置しています。

クオリティに関するもの

これも絵に詳しくないと検証が難しく、私が普段使っているものを紹介するに留めさせていただきます。コメントなどで皆さんのも教えていただけると嬉しいです。私は以下のものを全て入れております。なんとなく繰り返したりしております。
flat color, flat shading, lowres, error, extra digit, fewer digits, worst quality, low quality, poor quality, normal quality, jpeg artifacts, blurry, cropped, out of focus, bokeh, ugly, low res, 

それ以外

出て欲しくないものを書きます。

・ 指がぐちゃぐちゃになるのは一応
poorly drawn hand, extra hand, 
とかを使って防止しようとはしますが、効果はあんまり感じられません。そもそも手が出ていないポーズにする、くらいの効果が関の山でしょうか。
・ 画面が分かれたりするのを防止するのは下のものです。
different angle, multiple angle, two shot, multiple shot, 
但し、効果は微妙なように感じました。(あまり大声で言えないんですが、spread legsをかなり強調していたせいかもしれません。spreadという単語が入っているだけでNGなんでしょうか。それにしても品性がばれますね。)
・ その他にも、
long body, extra legs, bad hand, bad fingers, 
なんかも使ったりしますが、奇形防止の基本は、上で述べたようにプロンプトの最初の方でしっかりと構図を指定することだと考えています。
また、女性を描いてもらうと大きくなりがちですので、
big breasts, 
などで防止するのが良いかと思われます。特別小さいのが良い、という方は(((small breasts))), をお試しください。

彩度・明るさなどの調整も大事

大事で、しかもそんなに手間がかからないんですが、私はそんなに詳しくないのと、皆さんの画像編集の環境が分からない、それと好みの問題もありますので読み流す程度にしえもらえればと思います。素人なりのちょっとしたコツ、みたいなものを書きます。私はWindows11を使用しており、画像編集にはフォトってやつを使っています。パラメータは明るさ、露出、コントラスト、強調表示、シャドー、ふちどり、彩度、暖かさ、濃淡があります。

  • 露出は暗いところを明るくするのに使います。

  • 強調表示は明るいところを更に強調して明るくするのに使います。

  • おすすめの編集手順は、明るさをある程度暗くした後、露出と強調表示をいじり、最後に明るさをもう一度調整する、という感じです。露出と強調表示の調節が思い通りに行きやすいと思います。

  • 顔が暗いのを改善するときは、露出を高くしてみましょう。

  • 背景がまぶしすぎる時は、強調表示を低くしてみましょう。

  • 光沢などをはっきりさせるときは、強調表示はある程度の高さを保った方が良いです。

  • 明るいところと暗いところの差が激し過ぎるときは露出を高くして、強調表示を低くするのがいいと思います。

  • 露出や強調表示をもっと上げたいけど、全体的に明るくなりすぎてしまう!というときは、明るさをもっと下げましょう。

他のパラメータはよく分からないので特に言うことがありません…すいません…お好みでどうぞ…

その他のコツ

  • andを使うより、beautiful forest, dark forest, (beautiful and dark forest, ではなく)などと分けて書くのが良いかもしれません。どうしても一気に画像にそれらの要素を取り入れて欲しいときにandを使いましょう。

  • 全ての単語の後ろに「半角スペース+カンマ」を付けるようにし、コピーの際には先頭を単語、後ろを「半角スペース+カンマ」とすると、プロンプトのコピペなどの編集作業がやりやすくなります。

  • 私は役割の割り当てができるボタンがいくつか付いてる感じのマウスを使っています。コピーとペーストを割り当てて、できるだけマウスだけで作業が完結するようにしています。

  • モデルが違えば出力もかなり違ってきます。しかし同時に、トレーニングデータの著作権問題なんかもあって、難しいところです。

未検証なこと

検証したいけど未検証な事柄を以下にまとめました。

  • 「画面いっぱいに」の指示の仕方:現在close upでなんとかしておりますが、「○○を画面いっぱいに!」みたいなことの指示の仕方は

  • 効率的なプロンプトの実験方法:単語を入れたらどんな感じになるかスパーンと一発で出せたらいいですよねぇ…「このモデルではこの単語はどんな感じのニュアンスになるのかな?」とかありますもんね。

  • counterfeitでのぱっつん前髪の指示方法:現在well-groomed bangsで代用しておりますが顔どアップでの成功例はありません…

おわりに

ご高覧ありがとうございました。まだまだ始めたばかりで未熟なところも多いかとは思いますが、少しでも皆さんの参考になれば幸いです。
普段は激長プロンプトでやらせていただいているので、あんまり検証向きじゃないんですよね…
AIで生成した画像を巡る倫理的な議論には疎いので、私の記事には倫理規則に反するところがあるかもしれません。当然、なるべくの配慮はさせていただいております。「絵を描く」ではなく、「絵を描いてもらう」という表現を、冗長になるかもしれないと思いながらも多用したのは「お前が描いたんちゃうやろがい」とのご指摘をビビりな私が恐れたからです。
また、「~と思われます」などと書くべきところで、簡潔に書こうとしたせいで言い切ったような表現を使っているかもしれません。お気に障りましたら申し訳ありません。どうぞご指導ご鞭撻のほど、よろしくお願いいたします。

下に見出し画像のプロンプトのコピペと、出力した他の画像を載せておきます。画像は明るさなどがいじってあります。

beautiful dark scenery,

extremely cute face, (((close up))), well-shaped face, graphic face, beautiful face, highly detailed face, an extremely cute girl, facing at viewer, well-shaped face, graphic face, beautiful face, highly detailed face,
extremely cute, facing at viewer, extremely cute, blue crystal-clear eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, good cheeks, graphic cheeks, beautiful cheeks, highly detailed cheeks, good cheeks, good nose, well-shaped nose, graphic nose, beautiful nose, highly detailed nose, good nose, well-groomed bangs, beautiful blue hair, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped rips, graphic rips, erotic rips, beautiful rips, highly detailed rips, beautiful and cute rips, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, crystal-clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, good eyelashes, well-shaped eyelashes, graphic eyelashes, beautiful eyelashes, highly detailed lashes, good lashes,

beautiful dark scenery,

extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
bright highlights on skin, highlight spot on skin, glowing skin, beautiful detailed glow, light particles,
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),
extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
bright highlights on skin, highlight spot on skin, glowing skin, beautiful detailed glow, light particles,
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),

beautiful dark scenery,

extremely cute, facing at viewer, extremely cute, blue crystal-clear eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, good cheeks, graphic cheeks, beautiful cheeks, highly detailed cheeks, good cheeks, good nose, well-shaped nose, graphic nose, beautiful nose, highly detailed nose, good nose, well-groomed bangs, beautiful blue hair, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped rips, graphic rips, erotic rips, beautiful rips, highly detailed rips, beautiful and cute rips, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, crystal-clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, good eyelashes, well-shaped eyelashes, graphic eyelashes, beautiful eyelashes, highly detailed lashes, good lashes,
extremely cute, facing at viewer, extremely cute, blue crystal-clear eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, good cheeks, graphic cheeks, beautiful cheeks, highly detailed cheeks, good cheeks, good nose, well-shaped nose, graphic nose, beautiful nose, highly detailed nose, good nose, well-groomed bangs, beautiful blue hair, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped rips, graphic rips, erotic rips, beautiful rips, highly detailed rips, beautiful and cute rips, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, crystal-clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, good eyelashes, well-shaped eyelashes, graphic eyelashes, beautiful eyelashes, highly detailed lashes, good lashes,

beautiful dark scenery,

extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
bright highlights on skin, highlight spot on skin, glowing skin, beautiful detailed glow, light particles,
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),
extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
extremely cute face, well-groomed bangs, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes, bright eyes, clear eyes, clear and beautiful eyes, sparkling eyes, lovely eyes, good eyes, well-shaped eyes, graphic eyes, beautiful eyes, highly detailed eyes, good eyes,
bright highlights on skin, highlight spot on skin, glowing skin, beautiful detailed glow, light particles,
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),
good shading, good lighting, fine-tuned coloring, full color, super fine illustration, high quality, very high resolution, large filesize, good anatomy, happy face, vivid, good hair, graphic hair, beautiful hair, highly detailed hair, good hair, well-shaped eyes, clear and beautiful eyes, highly detailed eyes, good eyes, (((highly detailed))),

detailed scenery,
Negative prompt:
poor anatomy,
flat color, flat shading, lowres, error, extra digit, fewer digits, worst quality, low quality, poor quality, normal quality, jpeg artifacts, blurry, cropped, out of focus, bokeh, ugly, low res, flat color, flat shading, lowres, error, extra digit, fewer digits, worst quality, low quality, poor quality, normal quality, jpeg artifacts, blurry, cropped, out of focus, bokeh, ugly, low res, text,
Steps: 150, Sampler: Euler a, CFG scale: 7, Seed: 2085069154, Size: 640x320, Model hash: bd83b90a2e, Model: Counterfeit-V2.5, Denoising strength: 0.49, Hires upscale: 2.1, Hires upscaler: Latent

画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像
画像