![見出し画像](https://assets.st-note.com/production/uploads/images/156024317/rectangle_large_type_2_f8e58f9e1aff75ba275cb72c4eb17a37.png?width=1200)
AI生成画像からプロンプトを生成する実験
画像生成AIにおいて、これまでテキストをもとに画像生成することは一般的ですが、画像からそのプロンプトを生成することは一般的ではありませんでした。
昨今、いろいろなサービスで画像からのプロンプト生成が実現できるようになってきました。
そこで、どのくらいの精度なのか、どのような解釈をされるのかをみていたいと思います。
プロンプト入力→画像生成→プロンプト生成→画像生成
これを実施してみます。
オリジナルの画像
今回の元となる画像です。Midjourneyで生成しています。
![](https://assets.st-note.com/img/1727500697-P9YaXbCiWNwgLqT0c12xhfry.png?width=1200)
プロンプトはこちら、とても簡易的なものです。
野球場を廃墟化したところ、大穴になりました。AIの大胆な発想が素晴らしいですね。
abandoned ruined baseball dome, ruined, in Tokyo, abandoned, bird eye view, sunset --ar 500:707 --s 250
Midjourneyでプロンプト生成
さて、こちらをMidjourneyのdescribe機能で、テキストにしてみました。
4つのプロンプトが生成されました。
①A huge abandoned circular pool in the center of Tokyo, seen from above at sunset with red clouds and an orange sky. The city skyline is visible on both sides of it. In front of the swimming stadium, there is some green grass. A large number of spectators can be seen around the roofless pool. The water reflects the colors of the sunset beautifully. There was no one inside the empty round pool, which has black, rusted metal edges. Photo taken in the style of Kodak gold film. --ar 45:64
②A large abandoned circular swimming pool on the roof of an old factory building in Tokyo, Japan. The sky is painted with red and orange clouds at sunset. In front of it, you can see part of the downtown skyline at dawn. High-angle view. Captured in the style of Canon EOS R5. --ar 45:64
③The sun sets, the sky is colorful and beautiful, with clouds floating in it. The city skyline can be seen from above as if they were on top of an abandoned building. In front, there's a large circular pool filled with water that reflects the colors of the sunset. This photo was taken by photographer Kotaro Tomioka using a Sony A7R IV camera. It has been featured many times on Facebook. It's a masterpiece! I am so happy to have found such stunning photography in the style of Kotaro Tomioka. --ar 45:64
④A huge abandoned circular swimming pool in the center of Tokyo, with a stunning sunset, colorful clouds, and the city skyline in the background. Abandoned buildings surround the pool, creating a captivating and hyper-realistic scene. --ar 45:64
試しに①のプロンプトを実行してみました。
![](https://assets.st-note.com/img/1727500714-l4pG9IZxWUTJ1AseDzgF8kQB.png?width=1200)
色味がすこし違い、背景も違っていますね。
一方で、遠目で見ると雰囲気はかなり近いと思われます。
プロンプトはこちら。
A huge abandoned circular pool in the center of Tokyo, seen from above at sunset with red clouds and an orange sky. The city skyline is visible on both sides of it. In front of the swimming stadium, there is some green grass. A large number of spectators can be seen around the roofless pool. The water reflects the colors of the sunset beautifully. There was no one inside the empty round pool, which has black, rusted metal edges. Photo taken in the style of Kodak gold film. --ar 45:64 --s 250 --v 6.1
わかりやすいように日本語訳もしてみました。
東京の中心部にある、赤い雲とオレンジ色の空が広がる夕暮れ時に上から見た、放棄された巨大な円形プール。両側に街のスカイラインが見える。スイミング スタジアムの前には緑の芝生がある。屋根のないプールの周りには大勢の観客が見える。水は夕日の色を美しく映し出している。黒く錆びた金属の縁がある空の円形プールには誰もいない。コダックのゴールド フィルム風に撮影された写真。--ar 45:64 --s 250 --v 6.1
野球場のキーワードは消え、円形プールになっています。
それ以外の風景の描写が丁寧ですね。ひとつひとつ細かく説明していますね。
ChatGPTでプロンプト生成
次は、ChatGPTでプロンプトを生成してみました。
画像を与え、英語でプロンプトを返してもらうように依頼しています。
![](https://assets.st-note.com/img/1727500852-hB5WDS1jNCA9at3JyRfQscVH.png?width=1200)
雰囲気は似ているものの、だいぶ変わってしまいましたね。
野球ドームも巨大なプールもなくなり、小さな円形の空間になってしまいました。
An abandoned circular structure resembling a ruined stadium or large industrial tank in a cityscape at sunset. The cracked, weathered floor of the structure reflects the vibrant, fiery orange and purple clouds in the sky above. The surrounding urban environment features high-rise buildings, bridges, and industrial elements. The scene evokes a sense of desolation and beauty, with the colorful sunset contrasting against the decay of the structure --ar 45:64 --s 250 --v 6.1
こちらがプロンプトの日本語訳です。
やはり風景描写は丁寧です。全体感を表現するのには長けているようですね。
日没時の街並みの中に、廃墟となったスタジアムや大型工業用タンクのような、放棄された円形の建造物。ひび割れて風化した建造物の床には、上空の鮮やかな燃えるようなオレンジと紫の雲が映っている。周囲の都市環境には、高層ビル、橋、工業的な要素が見られる。色鮮やかな日没と建造物の荒廃とのコントラストが、このシーンから荒廃と美しさの感覚を呼び起こす --ar 45:64 --s 250 --v 6.1
まとめ
まとめると、画像を与えることで一定再現性のあるプロンプトを返してくれることがわかりました。
オリジナルで入力していない内容も表現しているため、入力時と出力時での解釈が異なっているようですね。
また、AIの特徴でもある全体感の表現は得意のようですが、細かい部分の再現は難しいようです。
今回は一度しか試行していないため、何度か実施すると結果が変わるかもしれません。