DEV Community

kaede
kaede

Posted on • Edited on

1

AI 基礎 Part 00 -- stable-diffusion / ChilloutMix を使って日本人美女の画像を作る

インストール

https://self-development.info/%E3%80%90stable-diffusion%E3%80%91chilloutmix%E3%81%AE%E5%88%A9%E7%94%A8%E6%96%B9%E6%B3%95/

selef-development.info

さんの記事を参考にする

https://civitai.com/models/6424/chilloutmix

この civit AI のサイトの chilloutmix のページに行き

Image description

ユーザー登録をして DL する。
タグに SEX ってあって草。

Image description

.safetensors という初めて見るファイルが DL できた。

これはライブラリだと解釈する。


AUTOMATIC1111 のインストール

ChilloutMix を動かすにはクライアントが必要。

https://self-development.info/automatic1111%e7%89%88web-ui%e3%81%ae%e7%b0%a1%e5%8d%98%e3%83%bb%e5%ae%89%e5%85%a8%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/

AUTOMATIC1111 をインストールする。

https://github.com/AUTOMATIC1111/stable-diffusion-webui

リポジトリに webui って書いてあってわかりやすい。



git clone 
git@github.com:AUTOMATIC1111/stable-diffusion-webui.git


Cloning into 'stable-diffusion-webui'...
remote: Enumerating objects: 16434, done.
remote: Total 16434 (delta 0), reused 0 (delta 0), pack-reused 16434


Receiving objects: 100% (16434/16434), 27.51 MiB | 9.35 MiB/s, done.
Resolving deltas: 100% (11493/11493), done.
kaede0902@rooter source % 


Enter fullscreen mode Exit fullscreen mode

git clone で DL して ディレクトリに入る。


python のインストールに失敗

python は Mac に入ってなかった。
asdf で必要なバージョンをインストールする

https://dev.to/kaede_io/kotlin-ji-chu-part-10-mac-de-openjdk-to-javahome-wodong-kasu-17k2

asdf はこの記事を参考にする

https://github.com/AUTOMATIC1111/stable-diffusion-webui#automatic-installation-on-windows

リポジトリを見ると 3.10.6 を入れろと書いてあった

asdf で入れると失敗した。

https://github.com/asdf-community/asdf-python/issues/98

現在の MacOS ではうまく入らないようだ。


brew で依存をまとめてインストール

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon



brew install cmake protobuf rust python@3.10 git wget

==> python@3.10                                                                     
Python has been installed as                                                        
  /opt/homebrew/bin/python3.10    


Enter fullscreen mode Exit fullscreen mode

入った

./webui.sh で起動

stable-diffusion-webui/models/Stable-diffusion

ここにモデルを置く必要がある 
入れないで起動すると pruned-emaonly がはいる。



 ./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

Running on local URL:  http://127.0.0.1:7860


Enter fullscreen mode Exit fullscreen mode

pruned-emaonly で 生成

birthday girl で出してみた

Image description

Image description

海外の小さい子供って感じ。


chillout を試す



ls models/Stable-diffusion 
Put Stable Diffusion checkpoints here.txt
v1-5-pruned-emaonly.safetensors


Enter fullscreen mode Exit fullscreen mode

ここに入れる必要がある。

chilloutmix のファイルを移動

Image description

昔のプリクラっぽい日本人ができた


他のユーザーが美女を公開しているコマンド集で作ってみる

他のユーザーの複雑なプロンプトを使って

どれくらい同じものができるのか検証する

Image description

Image description

画像右下に info マークがある画像は生成タグが公開されている



1girl,beautiful vintage color, instagram (photorealistic, high resolution:1.4), ((puffy eyes)), looking at viewer, , full body (8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37),(sharp focus:1.2), professional lighting, photon mapping, radiosity, physically-based rendering, (pale skin:1.2),(small breasts:1.2), looking at viewer, (middle hair:1.5), portrait, purple eyes, (sliver hair:1.1),bangs, (simple background:1.4), solo, upper body, realistic,(masterpiece:1.4),(best quality:1.4),(shiny skin),fashi-girl,makeup,smile(skinny,closed mouth,shy :1.3) ,(standing,black Stewardess uniform,Necromancer:1.1),medium bust,sexy pose , <lora:koreanDollLikeness_v15:1>


Enter fullscreen mode Exit fullscreen mode


paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, (outdoor:1.6), manboobs, backlight,(ugly:1.331), (duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:1.331), mutated hands, (poorly drawn hands:1.331), blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331), (more than 2 nipples:1.331), (missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051), (unclear eyes:1.331), bad hands, missing fingers, extra digit, (futa:1.1), bad body, NG_DeepNegative_V1_75T,pubic hair, glans (bad-artist:0.7)


Enter fullscreen mode Exit fullscreen mode

Image description

参考にしたプロンプト(タグ)の女の子と、髪の色から全然違う!

でもだいぶ綺麗に出てきてくれた。

2 つめはヌードが出てきたのでカット。

これは面白い。


タグを分析

これらで美女判定されそう

  • beautiful
  • instagram
  • makeup
  • fashi-girl

これらで写真のクォリティが上がってそう

  • professional lighting
  • full body (8k, RAW photo,
  • best quality, masterpiece:1.2),
  • (realistic, photo-realistic:1.37),
  • (sharp focus:1.2)

これらでポジションが良くなってそう

  • looking at viewer,
  • portrait
  • sexy pose

これらで髪型などの詳細が決まってそう

  • (middle hair:1.5),
  • purple eyes,
  • (sillver hair:1.1),

これで服が決まってそう。

(standing,black Stewardess uniform,Necromancer:1.1)

胸がはだけた服が多い。

ワードを変更

sillver-hair -> blonde-hair
upper body -> x

これらを変更して再生成してみた。

Image description

Image description

Image description

安定してブロンドで美女を生成できた!


今後やりたいこと

  1. 服のバリエーションを増やす。先ほどのプロンプトだと全て逆バニーになる。これらを出力できるようにする。
    • スーツ
    • 肩、腹、背中、など健全な露出
    • ふわふわのフリルの服
  2. ポーズのバリエーションを増やす。先ほどのプロンプトだと全て肖像画になる。Pixiv などを参考にする
  3. 顔を日本人に寄せる。Kolian v1 をみんな使っているように見える。調べる
  4. 表情を変える

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay