電通総研 テックブログ

電通総研が運営する技術ブログ

Stable Diffusion入門-美しい夜空を見渡す男

電通国際情報サービス、オープンイノベーションラボの比嘉康雄です。 Stable Diffusionシリーズ、今回は、美しい夜空を見渡す男の呪文です。

Stable Diffusionのおすすめコンテンツはこちら。

black silhuette of a man

最初は、シンプルな黒いシルエット(silhuette)の男のPrompt(呪文)ではじめましょう。星を見上げる男は、黒いシルエットのほうが雰囲気が出ます。

今回のPrompt(呪文)はこちら。

black silhuette of a man

出力された結果はこちら。

シンプルなPrompt(呪文)ですが、意外と雰囲気が出ていますね。

shot from the back

星空を見上げる男は、後ろから撮影し(shot from the back)、背景にきれいな夜空が広がっているような構図にしましょう。今回は、shot from the backのみを追加します。

今回のPrompt(呪文)はこちら。

black silhuette of a man,
shot from the back

出力された結果はこちら。

sitting on the ground

男を地面に座らせましょう。sitting on the groundを追加します。サブジェクト(メインとなる描画対象)に動作を付け加える場合、, 動詞のing ...を加えます。複数の動作を追加する場合も、, 動詞1のing ..., 動詞2のing ...のように記述します。

今回のPrompt(呪文)はこちら。

black silhuette of a man,
sitting on the ground,
shot from the back

出力された結果はこちら。

looking out into the sky

男が空を見渡すようにしてみましょう。looking out into the skyを追加します。

今回のPrompt(呪文)はこちら。

black silhuette of a man,
sitting on the ground,
looking out into the sky,
shot from the back

出力された結果はこちら。

colorful vibrant cosmos space, stars, nebula

空を美しい夜空にしてみましょう。the skyをcolorful vibrant(活気のある) cosmos space(宇宙空間), stars, nebula(星雲)に変更します。

今回のPrompt(呪文)はこちら。

black silhuette of a man,
sitting on the ground,
looking out into colorful vibrant cosmos space,
stars,
nebula,
shot from the back

出力された結果はこちら。

beautiful composition, beautiful soft purple blue lighting, cinematic lighting

画像のクオリティを上げるためには、服装、背景、構図、ライティングの指定が必要です。 今回、服装は必要なく、背景はすでに指定済みなので、構図とライティングを指定します。

構図は、beautiful compositionで良いでしょう。

ライティングは、定番のcinematic lightingにbeautiful soft purple blue lightingを追加しました。

今回のPrompt(呪文)はこちら。

black silhuette of a man,
sitting on the ground,
looking out into colorful vibrant cosmos space,
stars,
nebula,
shot from the back,
beautiful composition,
beautiful soft purple blue lighting,
cinematic lighting

出力された結果はこちら。

SIGMA art lens 24 mm F/1.4, ISO 1000, award-winning, concept art

これまで、画像のタイプを指定していませんでした。画像のタイプを指定しない場合、Stable DiffusionがPrompt(呪文)の内容から判断して決めます。今回は、写真にするために、SIGMA art lensを指定しましょう。

レンズについて詳しく知りたい方は、レンズ編を御覧ください。レンズ編を書いた後の研究で、art lensをつけたほうが、出力結果のクオリティが若干上がることがわかったので、art lensを追加しています。

美しい夜空を広く撮りたいので、広角レンズとして24 mmの焦点距離を選びました。

暗い場所の撮影なので、明るいレンズ(F/1.4)を選び、ISO感度に1000を指定しました。

最近の記事で結構つけ忘れていましたが、アニメ以外の画像は、award-winning, concept artをつけたほうが、クオリティが上がります。

今回のPrompt(呪文)はこちら。

black silhuette of a man,
sitting on the ground,
looking out into colorful vibrant cosmos space,
stars,
nebula,
shot from the back,
beautiful composition,
beautiful soft purple blue lighting,
cinematic lighting,
SIGMA art lens 24 mm F/1.4,
ISO 1000,
award-winning,
concept art

出力された結果はこちら。

black cliff, sunrise

the ground(地面)だと指定がアバウトすぎて、出力が安定しないので、一つ前の画像を見て思いついたblack cliff(崖)に変えることにします。

時間帯にsunrise(日の出)を指定して、美しい夜空と日の出が溶け込んでいる瞬間を狙います。

今回のPrompt(呪文)はこちら。

black silhuette of a man,
sitting on black cliff,
looking out into colorful vibrant cosmos space,
stars,
nebula,
shot from the back,
beautiful composition,
beautiful soft purple blue lighting,
cinematic lighting,
sunrise,
SIGMA art lens 24 mm F/1.4,
ISO 1000,
award-winning,
concept art

出力された画像はこちら。

まとめ

クオリティの高い画像を出力するには、サブジェクト(描画対象)、背景、構図、ライティングを きちんと指定することが必要です。指定しなくても、たまたまクオリティの高い画像が出力されることもありますが、あくまでも「たまたま」です。

サブジェクト(描画対象)、背景、構図、ライティングは、常に意識しましょう。背景、構図、ライティングは、パターンが決まっているので、早めに覚えてしまいましょう。

次回は、魅惑的な女アニメ画(トゥーンレンダリング)編です。

仲間募集

私たちは同じグループで共に働いていただける仲間を募集しています。
現在、以下のような職種を募集しています。

Stable Diffusionの過去コンテンツ

執筆:@higaShodoで執筆されました