![コンタクトシート-001](https://live.staticflickr.com/65535/52761967500_fb0b2fda66_c.jpg)
画像生成AI Stable DiffusionにはLoRA(Low-Rank Adaptation)というモデルに追加学習するための仕組みがあります。これを使えば特定のキャラクターなどを学習させて、画像生成に使うことができます。LoRAは好きなモデルに適用可能なので、アニメやゲームのキャラクターを学習させて、実写のモデルに適用するということも可能。ということで、LoRAを使ってコスプレ写真を生成させてみました。
![screencapture-civitai-2023-03-21-19_28_43](https://live.staticflickr.com/65535/52761787079_dee1033b86_c.jpg)
LoRAの作成は自分で行うことも可能ですが、CivitAIにLoRAのファイルが沢山公開されていますので、こちらで好きなキャラクターのLoRAをダウンロードして、”models/Lora/”に配置します。LoRAファイルの利用方法(必要なプロンプトなど)は公開サイトに書かれていますので、確認しておきます。
![screencapture-127-0-0-1-30000-2023-03-21-19_28_18](https://live.staticflickr.com/65535/52761537676_10fdb5f2ae_c.jpg)
Generateの下の真ん中の絵のアイコンをオスと、Loraのタブが出てきて、好きなLoRAファイルを選ぶとプロンプトにキーワードが追加されます。配布ページで指定されているキーワードも忘れず追加、その他のプロンプトも指定できます。
以下、試しにLoRAを使って生成した2次元画像(Anything v4.5モデルを使用)と3次元コスプレ画像(ChilloutMixモデルとJapanese Doll Likeness LoRAを使用)を載せておきます。EasyNegativeも使っています。
オリジナルとはだいぶ違っていますし、愛がこもった本物のコスプレには敵いませんが、全くプロンプトやパラメーターを調整していない感じでも、簡単に特定のキャラクターを生成したり、違う学習済みモデルに適用したりできるのはすごいですね。
![00237-516007089](https://live.staticflickr.com/65535/52761726670_dca1135bd3_c.jpg)
![00125-3610368346](https://live.staticflickr.com/65535/52761324481_1694619af1_c.jpg)
![00131-3603179213](https://live.staticflickr.com/65535/52761323446_2a0b9f677a_c.jpg)
Yae Miko | Realistic Genshin LORA
![00244-3190025750](https://live.staticflickr.com/65535/52761800818_41b0c31595_c.jpg)
![00093-1678443711](https://live.staticflickr.com/65535/52761718560_07f4a1ca94_c.jpg)
![00087-3441574991](https://live.staticflickr.com/65535/52761563814_3b9e2ba40b_c.jpg)
Kamisato Ayaka | 神里綾華 (Genshin Impact)
![00229-160100689](https://live.staticflickr.com/65535/52761722345_3a84666f2c_c.jpg)
![00114-2984759236](https://live.staticflickr.com/65535/52761723725_37c4746f40_c.jpg)
![00289-3441372782](https://live.staticflickr.com/65535/52761725360_913ee8381e_c.jpg)
![00255-610368079](https://live.staticflickr.com/65535/52761845948_7506e7e713_c.jpg)
![00263-1502990951](https://live.staticflickr.com/65535/52761847003_6481fccf87_c.jpg)
![00140-758205532](https://live.staticflickr.com/65535/52761855353_04c6482f0c_c.jpg)
2B (NieR:Automata) LoRA / YorHA edition
![00386-601033144](https://live.staticflickr.com/65535/52761921918_b9a5308a84_c.jpg)
![00418-3276040403](https://live.staticflickr.com/65535/52761861625_db2b0bd1e9_c.jpg)
目隠しバイザー付けさせるのは難しいですねw
![00425-1790000450](https://live.staticflickr.com/65535/52761946938_ea1e73a90c_c.jpg)
Shinobu Kochou (Demon Slayer) LoRA
![00216-3384140809](https://live.staticflickr.com/65535/52761578604_61361a7e93_c.jpg)
![00187-1043962449](https://live.staticflickr.com/65535/52761735955_2a569e3576_c.jpg)
![00184-1830101579](https://live.staticflickr.com/65535/52761330841_807df59351_c.jpg)
![00320-1458497313](https://live.staticflickr.com/65535/52761842703_2a57856263_c.jpg)
![00170-2046614298](https://live.staticflickr.com/65535/52761604509_0bcd8c7e9f_c.jpg)
![00327-2644410849](https://live.staticflickr.com/65535/52761603924_398f1ac1ac_c.jpg)
Lycoris Recoil-锦木千束/Nishikigi Chisato
![00221-3101221758](https://live.staticflickr.com/65535/52761306001_4ab9e019dc_c.jpg)
![00042-1254846423](https://live.staticflickr.com/65535/52761558349_2f1c872cae_c.jpg)
![00063-2062927685](https://live.staticflickr.com/65535/52761799708_da35b155ef_c.jpg)
Hitori Gotoh (Bocchi the Rock!)
![00336-3644933899](https://live.staticflickr.com/65535/52760860532_480546d627_c.jpg)
![00339-2207939101](https://live.staticflickr.com/65535/52760861157_2014b35950_c.jpg)
![00342-1098036123](https://live.staticflickr.com/65535/52760861357_db1599ae37_c.jpg)
Violet Evergarden 薇尔莉特·伊芙加登 ヴァイオレット・エヴァーガーデン
![00505-3721748138](https://live.staticflickr.com/65535/52762001258_13092bb17b_c.jpg)
![00486-3983712176](https://live.staticflickr.com/65535/52761764434_f9305756a7_c.jpg)
![00464-4131009404](https://live.staticflickr.com/65535/52761923550_e9206a9b44_c.jpg)
![00085-2316132060](https://live.staticflickr.com/65535/52765977269_c5e55f548c_c.jpg)
![00091-1966820161](https://live.staticflickr.com/65535/52765190152_f031f1d144_c.jpg)
![00089-4091160453](https://live.staticflickr.com/65535/52765981944_46304c0634_c.jpg)
![00027-3741947886](https://live.staticflickr.com/65535/52768389600_4ddb37378c_c.jpg)
![00022-2965075407](https://live.staticflickr.com/65535/52767438932_76554f20a3_c.jpg)
![00024-830833501](https://live.staticflickr.com/65535/52767983501_ec4ae5ace0_c.jpg)
どれもなかなかリアルなコスプレ画像ですね。
余談ですが、BingのAIが絵を描けるようになったというので試してみたところ、なかなかな嘘つきでした(笑)(私の環境ではまだ使えませんでした)
![スクリーンショット 2023-03-22 22.19.47](https://live.staticflickr.com/65535/52763653382_420e11f310_c.jpg)
![スクリーンショット 2023-03-22 22.19.56](https://live.staticflickr.com/65535/52763653582_9c53e0444b_c.jpg)
![スクリーンショット 2023-03-22 22.21.14](https://live.staticflickr.com/65535/52763653892_7f50076248_c.jpg)
![スクリーンショット 2023-03-22 22.22.11](https://live.staticflickr.com/65535/52764680498_9aed0158dd_c.jpg)
![スクリーンショット 2023-03-22 22.25.18](https://live.staticflickr.com/65535/52764601430_0c0d6abd08_c.jpg)
![スクリーンショット 2023-03-22 22.24.39](https://live.staticflickr.com/65535/52764601640_54aa01caa5_c.jpg)
ピンバック: 最新実写美少女モデル #BRAV5 と イラストモデル #AnythingV4 の併用による AIコスプレ写真 と #DepthLib での手の補正 #StableDiffusion #LoRA #ControlNet #コスプレ | Digital Life Innovator
ピンバック: 2023年の振り返り | Digital Life Innovator