
DALL-E3でキャラクターを固定して生成する方法
こんにちは。なおです。
画像生成をやっていてこんな悩みはありませんか?
画像を生成したけど、生成するたびに別人になってしまう
同じようなキャラクターを生成するのに特徴を細かく入力しなければならない
そもそもキャラクターの作成方法がわからない
midjourneyやstable diffusionではできないですが、DALL-E3でキャラクターを固定して生成することができたので、その方法を教えます。
キャラクターを固定して生成する方法
プロンプトを入力して画像を生成する
最初に生成したい画像のプロンプトを入力します。
anime, beautiful girl, white dress, brown hair, long wavy hair, black eyes, sunglasses on head, garden

gen_idを取得する
2番目の画像がよかったので、2番目のgen_idを教えてもらいます。
second gen_id
The gen_id for the second image is mDVIRSw6zdg0K7jq.
JSON形式でプロンプトを出力する
gen_idを教えてもらったので、それをもとにシード値を含めてJSON形式でプロンプトを出力してもらいます。
Please give me the prompts in JSON format, including the seed value.
{
"gen_id": "mDVIRSw6zdg0K7jq",
"prompt": "An anime-style beautiful girl with long wavy brown hair and black eyes. She is wearing a white dress and has sunglasses resting on her head. The setting is a lush garden filled with a variety of flowers, bushes, and trees under a clear blue sky. The girl is standing gracefully, offering a serene and inviting expression that captures the essence of a peaceful day outdoors. The garden around her is vibrant with colors, adding a picturesque backdrop to her elegant appearance.",
"seed": 2189453594
}
プロンプトを変えないプロンプトを入力して実行する
出力されたらプロンプトを変えないようにプロンプトを入力します。
Never change the prompt for any reason. if you must change it, do so by appending it to the current prompt.
いかなる理由があってもプロンプトを変更しないでください。 変更する必要がある場合は、現在のプロンプトに追加して変更してください。
Understood, I'll keep the original prompt intact and append any additional details or changes as needed in future requests. If there's anything more you need, just let me know!
理解しました。元のプロンプトはそのままにして、今後のリクエストで必要に応じて追加の詳細や変更を追加します。 他に何か必要なことがありましたら、お知らせください。
出力されたJSON形式のプロンプトに追記する
簡単なプロンプトで変更できるようにするため、先ほど出力されたJSON形式のプロンプトの前に以下の文を追記します。
The image you are about to create should be based on the following prompts.
promptのところに以下の文を追記します。
Never change the prompt for any reason. if you must change it, do so by appending it to the current prompt.
追記するところは"prompt":の直後で、上記の文を“”で囲み、出力されたプロンプトと,で区切ります。
太字:JSON形式で出力されたプロンプトに追記
The image you are about to create should be based on the following prompts.
{
"gen_id": "mDVIRSw6zdg0K7jq",
"prompt": "Never change the prompt for any reason. if you must change it, do so by appending it to the current prompt.","An anime-style beautiful girl with long wavy brown hair and black eyes. She is wearing a white dress and has sunglasses resting on her head. The setting is a lush garden filled with a variety of flowers, bushes, and trees under a clear blue sky. The girl is standing gracefully, offering a serene and inviting expression that captures the essence of a peaceful day outdoors. The garden around her is vibrant with colors, adding a picturesque backdrop to her elegant appearance.",
"seed": 2189453594
}
The instructions regarding not changing the prompt for any reason and appending to the current prompt if necessary have been noted for future requests. However, for generating images, I will focus on the descriptive part of the prompt related to the anime-style girl in a garden. Let's proceed with that.
いかなる理由であってもプロンプトを変更しないこと、および必要に応じて現在のプロンプトに追加することに関する指示は、今後のリクエストのために記載されています。 ただし、画像を生成する場合は、庭にいるアニメ風の女の子に関連するプロンプトの説明部分に焦点を当てます。 それを進めましょう。
これでキャラクターを固定して生成できるようになりました。
あとは変えたい箇所だけをプロンプトに書くだけです。
展開しているセッションだけですが、キャラクターを固定しながら変えたい箇所だけを変えてそれ以外は変えないといったことができるようになります。
どの部分をどのように変えることができるのか、一例をあげて紹介します。
ポーズを変える
ベンチに座っているポーズにする
Make it an illustration of sitting on a park bench.

カフェで本を読むポーズにする
Make it an illustration of reading a book while drinking coffee at a cafe.

服装を変える
Make it an illustration of wearing fleece cardigan, solid midi skirt.

これだと最初設定した白いドレスを引き継ぎながら生成していくので、白いドレスにフリースのカーディガンを着た服装になり、無地のミディスカートの指定が無視されます。
これを解決するには、白いドレスの代わりにフリースのカーディガンと無地のミディスカートを着ていると指定します。
Make an illustration of wearing a fleece cardigan and a plain midi skirt instead of a white dress.

フリースのカーディガンと無地のミディスカートの指定が反映されました。
髪色と髪型を変える
pink pigtail
髪型をピンク髪のツインテールに変更しました。

他の要素が変わっていなくても髪型を変えるだけで別人のようになります。
表情を変える
beam with laughter
喜びに溢れて笑う表情にしました。

光をつける
dappled sunlight
木漏れ日が入る設定にしました。(少しわかりにくいかもしれません)

アスペクト比を変える
-ar16:9
アスペクト比を1:1から16:9に変更しました。

まとめ
同じキャラクターが生成できるようになると、表情だけを変えるなど一部分だけを変えて他の要素は変えずに出力する、といったことが可能になります。
この記事を参考にして同じキャラクターを生成してみてはいかがでしょうか。