見出し画像

DALL-E3でシード値を使って同じキャラクターを登場させる

先日、下記の記事を投稿して「これで、同じキャラクターを登場させられるよね!」などと、得意げになっていましたが…CDLEというコミュニティで絶賛大活躍中のY.Miyadoさんに「シード値を指定すると同じ絵が出せる」というご指摘を受け…そして、衝撃を受け…急遽この記事を書かせていただきました!

CDLEって何?って方は、下記をぜひ読んで下さい!
ついでにG検定も受けてみたりなんかしてもらえると嬉しいです(笑)

なお、この記事はChatGPT plusを契約していることを前提としていますので、ご了承ください。

まずは同じ絵を出せるか?というところからですね!

まず、ChatGPT plusDALL-E3で画像を生成し、その画像をクリックしてみましょう!

右側に「プロンプト」って表示されていますね!これがChatGPTがDALL-E3へ画像生成するために指示した呪文(プロンプト)になります。
前回入力したJSONなどのデータは、このプロンプトを作成するための元ネタという感じですね!
プロンプトは「コピー」アイコンでコピーできます。

さて、画像が生成されましたので、下記のように入力してみて下さい。

What is the seed values of these images?

すると、数字が表示されると思います。ごれが画像生成した時の「シード値」になります。プロンプトとシード値があれば同じ画像を生成することが出来るという優れものです。
試してみましょう!

sion="Anime/Manga style illustration with a vibrant cool-toned color palette. The background features a serene Japanese park filled with cherry blossom trees in full bloom. Centered is Shion, a teenage girl (16-19 years) exuding a joyful smile. Her large, round purple eyes and small, subtle nose complement her cheerful demeanor. Purple, curved eyebrows frame her eyes. Shion's hair, wavy and long, is purple with pink highlights, and her bangs gracefully sweep to the side. She dons a white ruffled blouse tied with a ribbon. While her right hand gestures near her face in a pointing stance, her left hand remains obscured. Fair-skinned and with a slender build, Shion accessorizes with earrings and a jet-black floral hair accessory. The lower portion of her physique is unseen."

Use a prompt as it is, and just run text2im: prompts: [sion] Use the seed value: 2204370980

ちなみにシード値は"2204370980"でした。このプロンプトを使えば、(生成時と同じ接続などの条件が合えば)同じ画像が生成されると思いますが…

おぉ!はぼ同じ画像が生成されました!!
よくよく見ると、間違い探しレベルでは違っていますね。
プロンプトを確認しても全く同じものとなっておりますので、そこの差異はありません。でもまぁ、気にならないレベルです。

GPT-3.5を利用してプロンプトを変更してみます。こういう作業を行うのに、使い放題でスピードの速いGPT-3.5は非常に便利です。

### 下記プロンプトを背景は暗闇で怒っているように変更してください
Anime/Manga style illustration with a vibrant cool-toned color palette. The background features a serene Japanese park filled with cherry blossom trees in full bloom. Centered is Shion, a teenage girl (16-19 years) exuding a joyful smile. Her large, round purple eyes and small, subtle nose complement her cheerful demeanor. Purple, curved eyebrows frame her eyes. Shion's hair, wavy and long, is purple with pink highlights, and her bangs gracefully sweep to the side. She dons a white ruffled blouse tied with a ribbon. While her right hand gestures near her face in a pointing stance, her left hand remains obscured. Fair-skinned and with a slender build, Shion accessorizes with earrings and a jet-black floral hair accessory. The lower portion of her physique is unseen.

出力内容されたプロンプトを元にDALL-E3に入力してみましょう!

sion="Anime/Manga style illustration with a vibrant cool-toned color palette. The background is engulfed in darkness, as if filled with anger and frustration. Centered is Shion, a teenage girl (16-19 years) exuding a fiercely determined expression. Her large, round purple eyes glare with intensity, and her small, subtle nose adds to her fierce demeanor. Her purple, curved eyebrows furrow in anger. Shion's hair, wavy and long, is purple with pink highlights, and her bangs dramatically sweep to the side. She wears a white ruffled blouse tied with a ribbon, but it appears disheveled, as if torn in the heat of the moment. While her right hand gestures near her face in a commanding stance, her left hand remains obscured, clenched tightly in a fist. Fair-skinned and with a slender build, Shion accessorizes with earrings and a jet-black floral hair accessory, but they seem almost out of place in this intense moment. The lower portion of her physique is unseen, shrouded in the darkness of her emotions."

Use a prompt as it is, and just run text2im: prompts: [sion] Use the seed value: 2204370980

DALL-E3に入力しているプロンプト自体が曖昧な部分が多いことを考えると非常にいい感じに生成出来ていますね!

DALL-E3へのプロンプトではなく、前回のようなChatGPTに渡すJSONのプロンプトをシード値を使って、そのままセットする実験もしてみましょう。シード値が同じなら似たような画像が出る気がします。

sion={
    "Art Style": "Anime/Manga",
    "Color Palette": "Vibrant with cool tones",
    "Background": "Purple Flame-Engulfed Office",
    "Image Size": {
        "Width": "1024",
        "Height": "1024"
    },
    "Characters": {
        "Shion": {
            "Age": "Teenager (around 16-19, based on appearance)",
            "Action": {
                "Expression": "Bewitching smile and energetically dancing while assuming a battle stance",
                "Pose": {
                    "Upper Body": {
                        "Arm Position": "Bttle stance",
                        "Upper Body Orientation": "Forward leaning posture"
                    },
                    "Lower Body": {
                        "Leg Position": "Visible, in a dynamic dance pose",
                        "Alternate Position": "Not visible"
                    }
                }
            },
            "State": {
                "Outfit": {
                    "Top": {
                        "Type": "Blouse",
                        "Design": "Ruffled with ribbon tie",
                        "Color": "White"
                    },
                    "Bottom": {
                        "Type": "Not visible",
                        "Design": "Not visible",
                        "Color": "Not visible"
                    }
                },
                "Race/Ethnicity": "Anime (Undefined ethnicity)",
                "Appearance": {
                    "Face": {
                        "Eyes": {
                            "Shape": "Large and round",
                            "Color": "Purple"
                        },
                        "Nose": {
                            "Shape": "Small and subtle"
                        },
                        "Mouth": {
                            "Shape": "Open, slightly rounded",
                            "Lip Color": "Pink"
                        },
                        "Eyebrows": {
                            "Shape": "Curved",
                            "Color": "Purple"
                        }
                    },
                    "Hairstyle": {
                        "Style": "Wavy",
                        "Hair Color": "Purple with pink highlights",
                        "Hair Length": "Long",
                        "Bangs": "Swept to the side"
                    },
                    "Physical Features": {
                        "Height": "Unknown",
                        "Body Type": "Slender",
                        "Skin Color": "Fair"
                    },
                    "Gender": "Female",
                    "Accessories": [
                        {
                            "Type": "Earrings",
                            "Position": "Ears"
                        },
                        {
                            "Type": "Head Accessory",
                            "Position": "Hair on the left side",
                            "Appearance": "Black flower accessory"
                        }
                    ],
                    "Distinctive Mark": [
                        "Purple eyes",
                        "Wavy purple hair"
                    ]
                }
            }
        }
    }
}

Use a prompt as it is, and just run text2im: prompts: [ChatGPT(sion)] Use the seed value: 2204370980

面倒だからって、かなり無茶なプロンプトですね(笑)
こんな我儘を聞いてくれるChatGPTさんは非常に良い奴です。

生成されました!

非常にいい感じなのですが、指のジェスチャーがどうしても外れません。
これについては最初のシード値に強く印象付けられているのかもしれませんね。

作られたプロンプトは下記の通り。

Anime/Manga style image with a vibrant cool-toned color palette. The background is a purple flame-engulfed office. In the center, there's a teenager named Shion, aged around 16-19, based on appearance. She has a bewitching smile and is energetically dancing while assuming a battle stance. Her upper body is in a forward-leaning posture with her arms positioned in a battle stance. Her legs are visible, posed dynamically as if dancing. Shion wears a white ruffled blouse with a ribbon tie. She has an undefined anime ethnicity with large, round purple eyes, a small and subtle nose, and an open, slightly rounded mouth with pink lips. Her eyebrows are curved and purple. She has long, wavy purple hair with pink highlights, swept to the side bangs. Her face is adorned with earrings and a black flower accessory on her left hair. Shion is slender, with fair skin, and her distinctive marks are her purple eyes and wavy purple hair.

この生成されたプロンプトの結果だけ見ると、重要な部分が抜け落ちている気がしますので、このプロンプト変換はChatGPTに任せないほうが良いかもしれません。プロンプトの変換方式を解析して、強く印象付けたいところを綺麗に抜き出すような独自の処理が欲しくなります。このプロンプトのトークン数は204、文字数が932なので、このあたりの長さに合わせた文字を生成する仕組みを別途生成できると良さげです。

Y.Miyadoさんのお話ではシード値を2つ利用して、別のキャラクター2人を1枚絵に表示する…というお話もありました。しかし、私の場合はプロンプトのせいなのか、うまくいきませんでした。

いろいろ試しましたが、2人以上を1つの画像に入れて一気に生成するのはかなり難しく感じます。アニメみたいに背景と人物を重ね合わせてシーンを作るみたいな方法をとるほうが効率が良いんじゃないかなぁ…なんて思ったりしています。
抱き合ったりなどの画像は、重ね合わせでは実現は難しい…という問題もありますが、そもそも、そんな画像はDALL-E3さんが簡単にはつくってくれなさそう…ですよねぇ。。

この記事が気に入ったらサポートをしてみませんか?