メインコンテンツへスキップ
見出し画像

構図はChatGPT、画風はAnima|img2imgで「描けない構図」を自分の絵に【Anima】

    「この構図、プロンプトでどう書けばいいの…?」

    2人の描き分け、注ぐ・受け取る動作、頭の上の猫。タグにした瞬間、だいたい崩れます。

    ChatGPTやGrokでの画像生成は、Stable DiffusionでIllustriousやAnimaを使う場合と違い、日本語で指示できたり画像を参照させたりと、とても使い勝手がいいですよね。

    例えば、こんな構図を生成したいとします。

    午後の洋館のティールームの場面。
    画面左に、銀髪ロングヘアで赤いドレスの少女がいて、
    両手でティーポットを持って紅茶を注いでいる。
    画面右に、黒髪短髪で青い詰襟制服の少年が座っていて、
    両手でティーカップを差し出して紅茶を注いでもらっている。
    少年の頭の上には小さな白い子猫が乗っていて、
    ティーポットから立つ湯気を見つめている。
    テーブルの上には、マカロンがのった皿。
    窓から斜めに日差しが差し込んでいる。

    プロンプトでどうにかできる場合もありますが、Animaでも複数キャラや難しい構図を英語に言語化して生成するのはなかなか難しいです。

    画像
    なぜかマカロンに紅茶を注ぐ失敗例

    ですが、こんな構図もChatGPTやGrokなら比較的簡単に生成してくれます。

    画像
    生成指示をした例
    画像
    ChatGPTで生成した元画像

    でも、ChatGPTじゃ塗り感に満足できない、特有のノイズが気になるという方もいると思います。

    そこで今回、Stable Diffusion A1111やForgeNEOなら標準搭載であるimg2img(画像から画像生成:i2i)を使って、ある程度構図を維持しながら望んだイラスト生成をできる方法をご紹介します。

    実際ChatGPTで作成した画像をi2iしてみた結果がこちらになります👇

    1990s Style

    画像
    1990年代スタイル

    realistic

    画像
    リアル調スタイル

    自分好みの画風

    画像
    オリジナルスタイル

    「英語のプロンプトだけでは難しい構図が出せない」
    「ChatGPTで構図は作れるけど、塗りが好みじゃない」
    どちらかに当てはまるなら、この記事の方法がそのまま使えます。



    生成手順

    STEP 1|生成しやすいモデルで下絵を作る

    あなたが使いやすいと思うAIを使って下絵を作成してみてください。
    今回はChatGPTの画像生成に、文章で構図を伝えます。

    画像
    日本語から画像生成指示例

    ChatGPTなら画像を参照して人物を入れ替えたりもできるのでそういう用途でも使えます

    画像
    画像参照から生成した例

    STEP 2|下絵を見て、プロンプトを書く

    今回は生成モデルとしてAnimaを使います。

    ForgeNeoのimg2imgタブに下絵を読み込んで、プロンプトを書きます。

    画像

    Animaのプロンプトは、タグと文章を組み合わせるのがおすすめです。

    プロンプトが書けない方、大丈夫です。
    私も今回プロンプトはほとんど考えていません。

    プロンプトはChatGPTに考えてもらえばよいです。

    プロンプトを考えてもらうための指示文の例:

    この画像を、ローカルの画像生成モデル「Anima」
    (CircleStone Labs製、Cosmos-Predict2ベースのアニメモデル。
    Danbooruタグと自然言語を併用できる)で再現したいです。
    Animaの公式のプロンプトの書き方を調べてから、この画像の構図・キャラの描き分け・動作・小物をできるだけ再現できるポジティブプロンプトとネガティブプロンプトを作ってください。
    プロンプトは英語で、それぞれコードブロックで出力してください。

    ChatGPTが考えた先の下絵のプロンプト

    
    masterpiece, best quality, score_7, safe, highres, anime illustration, 1girl, 1boy, 1cat, indoors, tea party, afternoon, elegant interior, sunlight, warm lighting, detailed background,
    
    A beautiful, detailed anime illustration in a wide horizontal composition, showing a peaceful afternoon tea scene inside an elegant European mansion. Two young characters sit close together across a polished wooden tea table, with a small white kitten resting on the boy's head.
    
    On the LEFT side of the image is a beautiful young girl with very long flowing silver-white hair, soft red eyes, pale skin, and a gentle smile. She wears an elaborate deep crimson Victorian-style dress with black lace trimmings, puffed sleeves, decorative ribbons, and a red hair bow. She leans slightly forward toward the boy, carefully holding an ornate white porcelain teapot with BOTH hands, one hand gripping the handle and the other supporting the pot. The teapot is decorated with delicate pink rose patterns and gold accents. She is pouring a thin stream of amber-colored hot tea from the teapot's spout into the boy's teacup.
    
    On the RIGHT side of the image is a handsome young boy with short, slightly messy black hair, gentle dark eyes, and a subtle smile. He wears a dark navy-blue Japanese school uniform with a standing collar and polished gold buttons. He is seated on an ornate upholstered chair, facing the girl. He holds a single delicate white porcelain teacup with BOTH hands, extending it toward the girl to receive the tea. The cup is positioned directly below the teapot's spout, and the stream of tea flows visibly into the cup.
    
    A SINGLE small fluffy white kitten sits directly ON TOP OF THE BOY'S HEAD, balancing comfortably on his black hair. The kitten has soft white fur, tiny pink ears, round blue eyes, and a curled fluffy tail. It leans forward curiously, looking down at the delicate white steam rising from the hot tea being poured into the cup.
    
    In the foreground, a polished dark wooden table is covered with an elegant cream-colored lace table runner. At the center front of the table is ONE decorative porcelain plate holding EXACTLY THREE macarons, arranged side by side: one pink macaron, one pale green macaron, and one cream-colored macaron. Nearby are a matching floral porcelain sugar bowl, a small milk pitcher, and a vase of white roses.
    
    The background is a luxurious old-fashioned European mansion tea room, featuring carved wooden wall panels, antique bookshelves filled with leather-bound books, ornate golden picture frames, classical paintings, decorative candlesticks, heavy burgundy curtains, and elegant antique furniture.
    
    Large windows occupy the RIGHT side of the background. Warm golden afternoon sunlight streams DIAGONALLY through the windows, illuminating the girl's silver hair, the boy's face, and the rising steam. Beautiful sunbeams, soft shadows, subtle dust particles floating in the light, gentle atmospheric perspective, intricate fabric details, delicate porcelain reflections, richly detailed environment, romantic and peaceful atmosphere.
    
    Wide cinematic composition, medium shot, slightly elevated eye-level perspective, both characters visible from the waist up, girl positioned on the left, boy positioned on the right, teapot and teacup clearly visible between them, white kitten clearly visible above the boy, three macarons clearly visible in the foreground, expressive anime faces, delicate linework, soft painterly shading, warm golden color palette.

    このプロンプトをそのままプロンプトの欄にコピペすればよいです。
    (変えてもOK)

    ここに画風タグなど、いつもの設定を追加すればより自分好みにできるかと思います。
    (私の場合はLoRAを使用して画風を変えました)


    STEP 3|img2img の設定をして生成

    画像
    i2iの設定例

    基本的にデフォルトの数値で問題ないですが、
    Denosing Strenght(ノイズ除去強度)だけ0.3~0.4程度がおすすめです。
    先の下絵からi2iで画像を生成してみました。

    画像
    上:chatgptの下絵 下:i2i後
    画像
    上:chatgptの下絵 下:i2i後

    この中で重要な数値は④のDenoising strenghtです。
    その理由は次の章で解説します。


    Denoising strength はどの数値が適正?

    一番迷う、また失敗しやすいのがここだと思います。
    この数値を変えると元の画像から変わりすぎたり、全く変わらなかったりします。
    同じ下絵で、0.1から0.7まで並べてみました。

    画像
    0.1〜0.2  ほぼ下絵のまま(拡大して線が整うだけ)
    0.3〜0.4  構図はそのまま、塗りがAnimaに置き換わる ← おすすめ
    0.5       背景や小物から描き直しが始まる
    0.6       ケーキスタンドなど、下絵にない物が増える
    0.7       テーブルクロスが変わり、少女が立ち姿になる

    0.5を超えると、下絵にない物がどんどん増えていきます。
    せっかくChatGPTで作った構図を守りたいなら、0.3〜0.4が目安です。


    1990年代スタイルやリアル調スタイルの画風はどう生成したのか

    先の説明のDenoising strenghtの数値は、大きくするほど絵の雰囲気が変わります。

    数値を大きくしないと画風がうまく変わらない…
    でも、大きくしすぎると変わってほしくないものまで変わってしまう…
    こういうことも起こります。

    失敗例

    1990年代スタイルにしたい場合、プロンプトに「1990s (style)」
    という文字を入れるとこのような絵にすることができます。
    (リアル調なら「realistic」)

    画像
    1990s (style)
    画像
    realistic

    ところが、Denoising strength 0.4のままでは、なかなか望んだ画風に近づきません。

    画像
    Denosing strenght:0.4

    しかし、Denoising strenghtを大きくするとせっかくの下絵から崩れてしまいます。

    画像
    Denosing strenght:0.65

    対処法

    対処法としては2つあります。
    1つ目は、inpaintです。

    画像
    inpaint画面

    プロンプトはそのままでOKです。
    人物だけマスク(塗りつぶし)をしてDenoising strenghtを0.65で生成しました。
    そのあと全体をなじませるためにもう一度、i2iを0.4でします。

    画像
    inpaintのみ
    画像
    inpaint後にi2iで全体を馴染ませ

    2つ目は、ChatGPTに下絵の画風を変えてもらう方法です。

    画像を渡しつつ、スタイルの指定を指示します。

    画像

    その画像をi2iのDenoisng strenghtを0.4で生成します。

    画像
    ChatGPTでスタイル変更
    画像
    i2i後

    下絵を望んだ画風にあらかじめ近づけておくというのがポイントです。

    リアル調も同様手順です。

    画像
    ChatGPTでスタイル変更
    画像
    i2i後

    その他の失敗例

    画像

    Resizeで生成サイズを大きくしすぎる

    Animaなどのモデルには生成する画像の推奨サイズがあります。
    ここから大きく外れると上手く生成できない場合があります。
    詳しくは👇

    Shiftを3以外にしている

    t2iではshiftを変更して生成している方もいるかと思いますが、
    i2iの場合では「3」を推奨します。

    seedを固定している

    このi2iも一回ではうまくいかない場合があるのでseedをランダムにして何回も繰り返し生成してみることをおすすめします。

    文字が崩れる

    「時計の数字が、いつの間にか読めない記号に——。」

    画像

    文字は0.3でも描き直されます。
    看板、のぼり、時計の数字、描き文字。どれも崩れました。

    対処法:文字は後から入れ直すか、inpaintで人物だけ描き直す

    まとめ

    ここまで読んだあなたなら、もうできます。

    👉「構図は ChatGPT、仕上げは Anima」

    難しく考える必要はありません。
    まずは ChatGPTで1枚を作ってみてください。
    これだけで、プロンプトでは届かなかった1枚に手が届きます。

    ここまでご覧いただきありがとうございました。

    使ったLoRAは👇の方法で作成しています


    【使用環境】

    ・ChatGPT(画像生成)
    ・ForgeNeo(Anima-Base)
    ・Anima:https://civitai.com/models/2458426/anima
    ・拡張機能なし

    本記事は上記の環境で検証しています。
    「モデル」によって結果が大きく変わります。
    そのため、同じ設定でも違う結果になることがあります。
    うまくいかない場合はまずモデルの違いを確認してみてください。

    #生成AI #AIイラスト #AI画像生成 #画像生成AI #StableDiffusion #anima #img2img #ChatGPT #AI初心者

    あなたへのおすすめ