自社のウェブサイトや求人記事に、ストックフォトではなく自社の社員やロケーションを使って、自社らしさをビジュアルでアピールしたいというフェーズがありますよね。
せっかくよい写真が撮れたのに、その社員が退職することになって、あちこちに掲載した写真を取り下げなきゃいけない、みたいなこと、あると思います。
GoogleのImagen3のフォトリアル画像性能がよいというので、これを使って自社の画像をリファレンスに「生成画像なんだけどちょっと自社っぽい」画像を作ってみることにしました。
2ステップで「生成画像なんだけどちょっと自社っぽい」画像を生成する
ステップ1:自社画像からプロンプトを作る
手順は簡単で、自社の画像をimage2textでプロンプト化して、Imagen3(ImageFX)で画像を生成するだけです。
リファレンスの画像をChatGPTに添付して、下記のプロンプトを入力します。
画像を網羅的に分析し、視覚から情報を得ることが難しい人のために、英字のプロンプトリストの形式で英語で詳細に説明してください
画像中にテキストが含まれないようにしてください
見出しを使わず、平文で表示してください
プロンプトリストの形式は、英語の平文で、下記の順番で情報が並ぶように編集してください。
主題、人物の外見上の特徴と様子、背景、全体の雰囲気とトーン、特記事項
(ChatGPTに画像を入力することに抵抗のある場合は、OpenAI APIやAnthropic APIなどを活用してください)
ChatGPTが出力したプロンプトは下記。
ImageFXで人物を出力しようとするとき、特に指定しなければ欧米風の人物画像が出力されることが多いです。なので明示的に日本人を指定します。
また、写真素材として使う場合には、ある程度余白があった方がトリミング耐性が増えるので、余白を付与する意図のプロンプトも追加します。
具体的には下記のプロンプトを先頭に追記します。
Wide shot, with margins, Japanese,
ステップ2:ImageFXで画像を生成する
GoogleのImageFX - AI test kitchenにアクセスします。
ImageFX - AI test kitchenでは、デフォルトでImagen3を利用するようになっています。
image2imageもできるようになっていますが、今回は用いませんでした。
(訂正)
2024年8月30日時点で、image2image機能は提供されていません。表記誤りがあり申し訳ありませんでした。
ご指摘くださいありがとうございます。
先ほどのプロンプトを入力して画像を生成してみます。
リファレンス画像の状況、人物の動作と表情、服装や外見上の特徴、構図、雰囲気がよく再減されています。
特に、背景のオフィスの内装や什器の雰囲気が再現されていて、自社で撮影したイメージに近付いています。
ImgaeFXでは現在1x1の正方形画像しか生成できないため、左右方向の余白が少なく窮屈な印象になってしまいますが、将来3:2や16:9のアスペクト比が指定できるようになると解決すると思います。
前述した余白を確保するためのプロンプト(Wide shot, with margins,)は、効いているように感じることもあるし、そうでもないときもあり、おまじないレベルかもしれません。
画像出力の事例
同じ手法で他のパターンも生成したので、参考に列挙します。
例1:
例2:
例3:
例4:
ふりかえり
今回は、
を重視したフローを作りました。
image2imageを使うことも検討できますが、出力が期待したものと違った場合に、プロンプトが悪いのか、入力画像が悪いのか、あるいはその両方か、を考慮して修正する手間が発生するので、省いています。
個人的には、image2textで作ったプロンプトだけで、困りごとを解決するには十分満足できるクオリティの画像が出力できました。
この記事が役に立った、シェフを呼んでくれたまえ!という方は、いいね、記事のシェア、サポートなどで応援よろしくお願いいたします🙏
2024年8月30日
関連記事