◆1:ControlNet拡張機能を「Stable Diffusion web UI(AUTOMATIC1111版)」にインストール
「Stable Diffusion web UI(AUTOMATIC1111版)」を起動したら、
「拡張機能」をクリックしてから「URLからインストール」をクリックし、
URL入力欄に「https://github.com/Mikubill/sd-webui-controlnet」と入力して「インストール」をクリックします。
◆2:ControlNetのモデルデータをダウンロード
続いて、以下のリンク先にアクセスしてControlNetのモデルデータをダウンロードします。
webui/ControlNet-modules-safetensors at main https://huggingface.co/webui/ControlNet-modules-safetensors/tree/main
リンク先には、モデレーターがズラリと並んでいます。
今回は「ポーズを指定して画像生成」という機能を使いたいので「control_openpose-fp16.safetensors」をクリック。
>>28
以下のエラーが起こる場合、メッセージに従って、「settings」→「Stable-diffusion」の「Upcast cross attention layer to float32」にチェックを入れるとよいようです。
modules.devices.NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.
Stable Diffusion web UI(AUTOMATIC1111版)の場合
webui/models/Stable-diffusion へ上記モデルを移動
●プロンプト(=呪文)の基本的なコツ
プロンプト
very cute and beautiful girl, (アニメ風美少女のイラスト)
very cute and beautiful anime face and eyes (理想に近いアニメ風美少女のイラスト)
extremely beautiful detailed anime face and eyes (厚塗りタッチアニメ風美少女のイラスト)
school girl
maid girl
プロンプト
masterpiece, a very cute and beautiful girl, highly detailed face and eyes, clearly outlined, single character, beautiful blue hair, beautiful blue eyes, smile,1girl, sunlight, school uniform, background cherry blossoms and beautiful sky, spring, fold hands behind, dynamic pose, from above, standing,
・seedを固定(Seedの花びらボタンを押す) 同じ絵が出るようになる
・プロンプトの単語(birds など)を選択し、(Ctrl + ↑3回)で(birds:1.3)となり、目的画像を多く描き出せるようになる
・言葉を()で区切れば強調できるが、現在は(birds:1.3)「鳥の数を1.3倍に」という書き方が主流
・言葉を抑制したいときは(birds:0.5)などと書く
・[ ]大カッコは画像の差し替えを意味してしまうため、使用しない
[a girl : a dog :8]とすると、8ステップ目に画像が少女から犬に切り替わり、犬顔少女となる
・[cow | horse] in a field とすると、1ステップ毎にサンプル画像が牛と馬で切り替わり、合成した体形の動物となる
・a cat AND a dogとすると、猫犬が混ざった動物となる
「Stable Diffusion Web UI」で、「ChilloutMix」を使う
モデルデータ「Chilloutmix-Ni-pruned-fp32-fix.safetensors」を使う
プロンプト
head portrait, realistic, 1girl, eyes, loli, lots of frills, black long dress, starry sky, black hair blowing in the wind, trees, bloom light effect
Stable Diffusion web UI(AUTOMATIC1111版)でChilloutMixを使う
「chilloutmix_cilloutmixNi.safetensors」を「stable-diffusion-webui/models/Stable-diffusion」ディレクトリに設置します。
3.プロンプト〜パラメータの設定
sample
プロンプトには「head portrait, realistic, a girl, beautiful blue eyes, cool, blond hair blowing in the wind, trees, blue sky」
ネガティブプロンプトには「worst quality」
【Positive】
masterpiece, best quality, ultra high res,(photo realistic:1.4),((1girl)), upper body, close up of face shot, big blue eyes, medium breasts, cleavage, cat ears, blonde hair, very long hair, maid costume with a lot of frills, cute, young, posing, looking at viewer, cyberpunk, night city, neckless, cross, <lora:koreanDollLikeness_v15:0.3>
「メイド服を着た超かわいい猫耳美少女の画像を、顔にフォーカスして生成してほしい」
よく使われるプロンプト
best quality:最高品質
masterpiece:傑作
ultra high res:超高解像度
highres:高解像度
4K、8K
detailed faceやdetailed clothesなど
ポジティブプロンプトを作成する上でおすすめの順番は、次の通りです。
品質上昇系(2〜3個が目安)
モデルの数(1girl, solo, 2girlsなど)
イラストの全体図(full body, upper body, close up of face shotなど)
モデルの外見に関する情報(髪型・目の色・服装など)
モデルのポーズ(posing, sitting, looking at viewerなど)
背景に関する情報
LoRAやembeddingsの比重
ネガティブプロンプト
【Negative】
painting,sketches,(worst quality:2),(low quality:2),(normal quality:2),lowers,normal quality,((monochrome)),((grayscale)),skin spots,acnes,skin blemishes,age spot, nsfw,ugly face, fat,missing fingers, extra fingers, extra arms, open chest
輪郭やポーズを推定するモデルが必要
ControlNetはインストールしただけでは動作しない。
輪郭やポーズを抽出するモデルを別途入れる必要がある。
次のサイトに抽出する手法別にデータが分かれているので欲しい物をDLする。
v1.1対応版:lllyasviel/ControlNet-v1-1 at main
pthファイルとyamlファイルを保存する必要あり?
v1.0までのモデルは次のサイトからDLする。1.1以降でも古いモデルを使用可能。
lllyasviel/ControlNet at main