![見出し画像](https://assets.st-note.com/production/uploads/images/108334888/rectangle_large_type_2_7145ebb7e398b2c86183e636d73525af.jpeg?width=800)
【無料】画像からプロンプトを逆錬成して、新たなAI画像を作成する方法
AI画像生成においては「プロンプトから画像を生成する」という方法が一般的ですが、「あの画像の構図を参考にしたいな」「あの写真を参考に、オリジナルなAI画像を生成したい」といったケースがあると思います。
その際に必要になってくるのは、生成したい画像に描かれる構図や情景をプロンプト化するための言語化スキルです。生成AIの利用時はプロンプトをいかに効率的に詳細化できるかが、望む構図の画像を生成できるかのキーとなりますよね。
今回は「既存の画像の構図からプロンプトを逆錬成して、そこから新たなAI画像を生成する方法」をご紹介します。
なお例として使用する画像生成AIは例によって Midjourney ですが、他の画像生成AIでも良いでしょう。
Midjourney自体には画像から画像の構図を説明するプロンプトを生成できる /describe というプラグイン機能が使えますが、/describe で生成するプロンプトはかなり「ざっくり」しているので、個人的にはちょっと手間はかかるものの今回ご紹介する手法をオススメします。
必要なもの
参考にしたい画像
ChatGPTとSceneXplainプラグイン
Midjourney (Stable Diffusion や Bing Image Creatorでも良いでしょう)
これでもうお解りだと思いますが、
ChatGPTと「SceneXplain (scene explain = 場面説明)」を使って、参考にしたい画像の説明テキストを生成
生成したテキストをプロンプトとしてMidjourneyに流し込んで画像生成
という流れです。
ChatGPTでSceneXplainプラグインを準備する
重要なツールはChatGPTと SceneXplain プラグインです。
プラグインが使えるChatGPTはGPT-4ですので、ChatGPT Plusを契約している必要があります。
ChatGPTをバリバリ使いこなしている方は基本的にPlusユーザーだと思いますので、特に問題は無いでしょう。
GPT-4モードでプラグインを有効化し、SceneXplain プラグインをインストールします。このプラグインは画像の内容をテキストで説明してくれるという優れものです。
ChatGPTの Plugin store で "SceneXplain" を検索してインストールします。
![](https://assets.st-note.com/img/1686841735212-vsl20ox9yf.png)
パターン1:風景写真をもとに似た構図の風景写真を生成する
参考となる風景写真を用意します。
ここでは pixabay から こちらの画像 をチョイス。
![](https://assets.st-note.com/img/1686842345442-ZDmbFXCM98.png?width=800)
画像アドレス(画像の直接的なURL)が必要なので、ブラウザを使ってURLを取得します。
Chromeであれば、だいたいの場合は右クリック→「画像アドレスのコピー」で取得できます。
![](https://assets.st-note.com/img/1686842492078-uonv2vzbCL.png?width=800)
https://cdn.pixabay.com/photo/2023/05/28/09/24/south-tyrol-8023224_1280.jpg
が画像アドレスとなります。これを使って、ChatGPT + SceneXplain で画像内容を説明するテキストを作成します。ChatGPTに与えるプロンプトは
「画像URL」
のみで十分です。
![](https://assets.st-note.com/img/1686984305722-D8tXjpw1di.png?width=800)
このように、画像の内容の詳細な説明テキストを生成してくれます。プロンプトとしては冗長ですが、このまま使ってみましょう。
ここで、生成画像のテイストを実写・フォトリアル風にしたいので、次のキーワードだけをプロンプトの先頭に付与して画像を生成します。
Landscape-photography; photorealistic-picture; Nature;
あとはこのキーワードに続けて SceneXplain が生成したテキストをプロンプトとしてMidjourneに流し込めば画像が生成されます。
Landscape-photography, photorealistic-picture; Nature;
The image you provided is a breathtaking view of a mountainous landscape. At the center, a majestic range of snow-capped mountains rises high above the horizon. The peaks are tinted with various shades of blue, creating a tranquil atmosphere. Dense forests of evergreen trees flank the mountain range, forming a lush barrier that separates the peaks from the rest of the landscape. In the foreground, a woman stands surrounded by trees, looking out towards the mountain range. She is silhouetted against the bright, sun-drenched sky, which is partially obscured by a veil of clouds. The image captures a serene moment, with the sun shining over the mountain range and casting long shadows on the tree-lined valley below;
--ar 16:9
![](https://assets.st-note.com/img/1686984762813-hhlbb6lpjA.png?width=800)
いい感じに生成されましたね。いわゆるパクリではない、参考画像から「抽出した構図の説明テキスト」から新たに生成された風景画像となりました。
パターン2:人物写真をもとに似た構図の人物写真を生成する
次は人物写真を生成してみます。
ここでも pixabay から こちらの画像 をチョイス。
![](https://assets.st-note.com/img/1686843287784-morVdatR19.jpg?width=800)
https://cdn.pixabay.com/photo/2016/03/14/14/21/bride-1255520_1280.jpg
男女の結婚をイメージさせる写真です。この画像の説明を ChatGPT + SceneXplain に作ってもらいます。
![](https://assets.st-note.com/img/1686984791390-nq2ll3RTAU.png?width=800)
問題なく生成されたので、Midjourneyに流し込んでいきます。
こちらもプロンプトに「ひと手間」かけます。
ポートレイト写真風、幸福感のあるフォトリアルテイストで生成したいので、次のキーワードをプロンプトの先頭に追加します。
Portrait-photography; Happiness; photorealistic-picture;
次はこのキーワードに続けて SceneXplain が生成したテキストをプロンプトを Midjourney にセットして画像を生成します。
Portrait-photography; Happiness; photorealistic-picture;
The image depicts a joyful and romantic occasion featuring a lovely bride and groom. The couple stands together holding a bouquet of flowers, sharing a sweet kiss. The man is attired in a black suit with a bow tie and a beard, while the bride is in a white wedding gown. The bouquet comprises lush roses and other exquisite flowers. Interestingly, there's another man in the image, also holding a bouquet of flowers. He is wearing a black suit with a white shirt and no tie. The image provides a close up of this man's ear and face, highlighting his beard and proud expression. The background consists of a muted cream color, which complements the neutral palette of the suits; --ar 4:3
![](https://assets.st-note.com/img/1686984937973-e0cKG7i7b0.png?width=800)
ぱっと見は全く異なる画像ではありますが、結婚をイメージさせる男女が花束を挟んで向き合っている構図は同じです。追加したキーワードの効果もバッチリ出ていますね。
パターン3:人物写真をもとに似た構図のイラスト画像を生成する
パターン2ではポートレイト風のフォトリアルな画像を生成しましたが、同じ構図説明テキストからのプロンプトを使って「油絵風のイラスト」を生成してみましょう。
先程はプロンプトの先頭にフォトリアル仕上げを狙う
Portrait-photography; Happiness; photorealistic-picture;
を付けましたが、今回は油絵風の仕上げを狙う
Oil-painting; Happiness; illustration;
に変更します。
そして、生成結果は次のような画像となりました。
Oil-painting; Happiness; illustration;
The image depicts a joyful and romantic occasion featuring a lovely bride and groom. The couple stands together holding a bouquet of flowers, sharing a sweet kiss. The man is attired in a black suit with a bow tie and a beard, while the bride is in a white wedding gown. The bouquet comprises lush roses and other exquisite flowers. Interestingly, there's another man in the image, also holding a bouquet of flowers. He is wearing a black suit with a white shirt and no tie. The image provides a close up of this man's ear and face, highlighting his beard and proud expression. The background consists of a muted cream color, which complements the neutral palette of the suits; --ar 4:3
![](https://assets.st-note.com/img/1686985014222-fJ3HoV7bB0.png?width=800)
写真風ではない、指定どおりの油絵風の仕上がりです。
まとめ
以上のように、ChatGPT + SceneXplain プラグインを使うと既存の画像から「画像の構成を説明するテキスト」を生成することが可能なため、このテキストをプロンプトとして利用することができます。
これなら、プロンプト自体を作成する言語化スキルにちょっと自信が無い場合でも、概ね十分と言えるプロンプトを作ることが可能です。
(プロンプトとしては整理されていないので冗長にはなりますが)
また、ChatGPT用プラグインの SceneXplain は Midjourney の /describe よりも状況の描写や説明を詳細に生成してくれるため、より表現力の高い画像を生成してくれることが期待できます。
元画像と新たに生成する画像の間には100%のプレーンテキストとしてのプロンプトが介在するためトレースにはなりませんが新たに生成する画像を特に商用利用する場合、やはり元画像の著作権には一定の配慮は必要でしょう。新たな画像を生成するためのプロンプトには、既存著作物の作品名や著作者名・絵師さんの名前などは絶対に含めないようにしましょう。
この記事が気に入ったらサポートをしてみませんか?