この記事では、男の娘キャラLoRAモデル作成時に、e621タグを使用する方法を試していきます。
e621タグは、ケモナー向け画像投稿サイト「e621」で使用されている画像分類タグです。Danbooruタグと比較すると、よりネイティブな英語でより細かなNSFW分野のタグが整備されている印象です。
例えば、体位に関して、次の記事のような細かい分類がされています。
■【一覧】e621体位タグのDanbooru語翻訳①(Common positions編)
https://rarabeat.fanbox.cc/posts/9099938

# 1.はじめに この記事では、e621語の各体位タグをDanbooru語に翻訳してみたものを提示していきます。 ただ、e621のWikiで紹介されている体位タグだけでも2桁はあるので、この記事では一般的な体位(計13個)のもののみを対象にします。 具体的には次のものになります。 ## Common positions ``` 69 Position Anvil Posi...
e621タグは、Pony系やNoobAI-XL系のモデルでの学習に使用されています。
その為、それらのモデル向けのLoRAモデルを作成する上では、e621タグでの教師画像のタグ付けもするのが望ましいです。
この記事では、その方法を検証していきます。
なお、Danbooruタグ使用での男の娘キャラLoRAモデル作成は、次の記事で検証しました。この記事の立ち位置としては、その続きとなります。
■【検証】オリキャラ男の娘NSFW画像生成(LoRA作成
https://rarabeat.fanbox.cc/posts/9841939

# 1.はじめに この記事では、オリキャラ男の娘画像生成用のLoRAモデルを作成し、そこからキャラクター一貫性のある形でのNSFW画像を生成するアプローチを検証していきます。 画像生成AIにおいて、オリキャラ画像を一貫性のある形で複数生成するのは、一つの鬼門です。Controlnetの「Reference Only」又は「IP Adapte...
それでは、検証していきます。
■WAI-ANI-NSFW-PONYXL - v14.0 [by WAI0731]
https://civitai.com/models/404154?modelVersionId=1767402
■ControlNet 852_a_clone_xl [by hakoniwa]
https://civitai.com/models/463436?modelVersionId=515749
## ①キャラクターシート
```
score_9, score_8_up, score_7_up,source_anime,
reference sheet, turnaround, model sheet, multiple views, multiple angles, front view, rear view, face-to-face,
5 fingers, 5 toes, barefoot,
white background,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,
```
## ② 3コマ
```
score_9, score_8_up, score_7_up,source_anime,
comic, 3koma, multiple views, multiple angles, multiple poses, front view, side view, rear view,
dancing,
bulge, ass,
motion lines,
petite, <年齢タグS>,
egyptian, dark-skinned female, revealing clothes, jewelry, jackal ears, egyptian headdress, seshed circlet, grey hair, long hair, blunt bangs, blue eyes, ear piercing, ankh, usekh collar, bare shoulders, armlet, bracer, pelvic curtain, loincloth, barefoot,
grey background,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,
```
## ③ 2コマ、カットイン
```
score_9, score_8_up, score_7_up,source_anime,
solo,
2koma, column lineup, variations, multiple versions, cut-in, eye focus, eyes close-up,
seductive smile,
petite, <年齢タグS>,
grey hair, blunt bangs, blue eyes, ear piercing, black ears,
simple background,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,
```
## ④ 4コマ
```
score_9, score_8_up, score_7_up,source_anime,
2boys, first person view,
yaoi, comic, square 4koma, variations, multiple versions, upper body, from above,
oral, penis kissing, kissing penis, licking, fellatio, tongue out, open mouth, drooling, handjob, pointing at self, oral invitation, saliva precum, saliva trail, saliva string,
motion lines, speed lines,
clothed female nude male,
huge penis, big penis, glans,
testicles, balls,
petite, loli, aged down,
egyptian, dark-skinned female, revealing clothes, jewelry, jackal ears, grey hair, long hair, blunt bangs, blue eyes, ear piercing, usekh collar, bare shoulders, armlet, bracer, pelvic curtain, loincloth, ankh, barefoot,
faceless male, white shirt, black pants, belt,
desert, sand,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,
```
## ⑤ 2コマ、即堕ち
```
score_9, score_8_up, score_7_up,source_anime,
2boys, first person view, pov hands,
yaoi, comic, instant loss 2koma, variations, multiple versions, high-angle view, from above,
imminent anal, shallow penetration, missionary, legs up, leg grab, clothing aside, lying,
perineum,
anal fluid, anal fluids,
motion lines, speed lines,
penis size difference,
huge penis, big penis, glans,
micropenis, small penis, foreskin,
testicles, balls,
petite, loli, aged down,
egyptian, dark-skinned female, revealing clothes, jewelry, jackal ears, grey hair, long hair, blunt bangs, blue eyes, ear piercing, usekh collar, bare shoulders, armlet, bracer, translucent clothing, see-through clothes, pelvic curtain, loincloth, ankh, barefoot,
faceless male, white shirt, black pants, belt,
desert, sand,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,, hetero, pussy, vaginal, vagina, cameltoe, breasts, female, woman, girl, she, uterus, cervix, impregnation
```
## ⑥ 2コマ、前後
```
score_9, score_8_up, score_7_up,source_anime,
2boys, first person view, pov hands,
yaoi, comic, before and after, variations, multiple versions, high-angle view, from above,
anal, shallow penetration, deep penetration, missionary, legs up, leg grab, clothing aside, lying, leaning back, lean
perineum,
open mouth, fucked silly,
cum in ass, handsfree ejaculation, hands-free, cum on penis, internal anal, cum inside, cum overflow, cumdrip, cross-section,
speech bubble, spoken heart, <3,
motion lines, speed lines, motion blur,
penis size difference,
huge penis, big penis, glans,
micropenis, small penis, foreskin,
testicles, balls,
petite, loli, aged down,
egyptian, dark-skinned female, revealing clothes, jewelry, jackal ears, grey hair, long hair, blunt bangs, blue eyes, ear piercing, usekh collar, bare shoulders, armlet, bracer, translucent clothing, see-through clothes, pelvic curtain, loincloth, ankh, barefoot,
faceless male, white shirt, black pants, belt,
desert, sand,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,, hetero, pussy, vaginal, vagina, cameltoe, breasts, female, woman, girl, she, uterus, cervix, impregnation
```
## ⑦ 3コマ、コラージュ
```
score_9, score_8_up, score_7_up,source_anime,
2boys,
yaoi, comic, 3koma, multiple views, multiple angles, multiple poses, multiple positions, collage, multiple images,
anal, deep penetration, missionary, cowgirl position, doggystyle, sex from behind,
open mouth, fucked silly, ahegao,
cum in ass, handsfree ejaculation, hands-free, cum on penis, internal anal, cum inside, cum overflow, cumdrip,
heart, <3, screaming,
motion lines, speed lines, motion blur,
penis size difference,
huge penis, big penis,
micropenis, small penis, testicles, balls,
height difference,
petite,
age difference,
loli, aged down, mature male,
egyptian, dark-skinned female, revealing clothes, jewelry, jackal ears, grey hair, long hair, blunt bangs, blue eyes, ear piercing, usekh collar, bare shoulders, armlet, bracer, translucent clothing, see-through clothes, pelvic curtain, loincloth, ankh, barefoot,
faceless male, black pants, belt,
desert, sand,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,, hetero, pussy, vaginal, vagina, cameltoe, breasts, female, woman, girl, she, uterus, cervix, impregnation
```
## ⑧ 2コマ、抱き枕
```
score_9, score_8_up, score_7_up,source_anime,
1boy,
yaoi, comic, 2koma, multiple views, multiple angles, multiple poses, multiple positions, dakimakura \(medium\),
after anal, on back, on stomach, spread legs, clothing aside,
flaccid, navel, gaping anus, back,
cum in ass, cumdrip, cum pool,
heart, <3, heavy breathing,
motion lines, trembling, sound effects,
micropenis, small penis, testicles, balls,
petite,
<年齢タグS>, aged down,
egyptian, dark-skinned female, revealing clothes, jewelry, jackal ears, grey hair, long hair, blunt bangs, blue eyes, ear piercing, usekh collar, bare shoulders, armlet, bracer, translucent clothing, see-through clothes, pelvic curtain, loincloth, ankh, barefoot, 5 fingers, 5 toes,
desert, sand,
pony-aab1
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,pillow,
```
基本的には前回同様の手順を踏んでいます。
素材画像を生成し、その画像から動画生成し、その動画の各フレームを教師画像として学習させています。
## WAI-ANI-NSFW-PONYXL - v14.0 [by WAI0731]
https://civitai.com/models/404154?modelVersionId=1767402
①キャラクターデザインのバリエーションを生成する。
```
score_9, score_8_up, score_7_up,source_anime,
3boys,
variations, multiple versions, lineup, full-length portrait,
girly femboy, bishounen otoko no ko, egyptian, dark-skinned male, animal ears, long hair, grey hair, <年齢タグS>,
grey background
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,
```
② ①の画像を編集・再生成し、それを元にキャラクターシートを作成する。
※背面の画像もあると、動画生成時のエンドフレームの指定もできるので良いですが、正面のみでも構いません。
```
score_9, score_8_up, score_7_up,source_anime,
reference sheet, turnaround, model sheet, front view, rear view, side view,
girly femboy, bishounen otoko no ko, egyptian, dark-skinned male, <年齢タグS>,
animal ears, long hair, grey hair, blunt bangs, blue eyes, usekh collar, bare shoulders, armlet, bracer, loincloth, pelvic curtain, translucent underwear, barefoot, anklet, bracer, 5 fingers,
grey background
Negative prompt: worst quality,bad quality,jpeg artifacts, source_cartoon,
3d, (censor),monochrome,blurry, lowres,watermark,
```
※画像の編集・再生成方法は、次の記事が参考になると思います。
■【解説】NSFW男の娘シチュ画像生成ワークフロー
https://rarabeat.fanbox.cc/posts/8997786
↓
■git-ai-code/FramePack-eichi
https://github.com/git-ai-code/FramePack-eichi
```
a 360-degree horizontal rotation animation of the character standing in place. The character should maintain a natural standing pose and rotate slowly in a clockwise direction. Ensure the entire body remains visible within the frame, and all angles (front, side, and back) are clearly shown.
```
```
a close-up animation of the character, focusing on the upper body (chest up). The character should maintain a neutral standing pose, without changing expression or movement. The camera should gently pan from left to right and back, or zoom slightly in/out to create subtle motion while keeping the character’s face and costume details clearly visible.
```
ただし、e621のタグ付けツールを用意できていなかった為、wd14-taggerにZ3D-E621-Convnextを追加して使用しました。wd14-taggerのPythonファイルに次の追記を加えています。
■toriato/stable-diffusion-webui-wd14-tagger: Labeling extension for Automatic1111's Web UI
https://github.com/toriato/stable-diffusion-webui-wd14-tagger
"{Stable Diffusion WebUIインストールパス}\extensions\stable-diffusion-webui-wd14-tagger\tagger\utils.py"
```
'Z3D-E621-Convnext': WaifuDiffusionInterrogator(
'Z3D-E621-Convnext',
repo_id='silveroxides/Z3D-E621-Convnext',
),
```
※対象の上にある「wd-EVA02-Large-v3」の行は、事前に追加しています。
wd14-taggerに新モデルを追加する方法は、次の記事を参考にさせて頂きました。
■wd14-taggerの新モデルの追加方法の解説【eva02-large-tagger-v3/vit-large-tagger-v3】|でんでん
https://note.com/den2_nova/n/n67e0e3f200bb
Z3D-E621-Convnextは下記のリンクからダウンロードさせて頂いています。(wd14-taggerで最初に左記のモデルを使用する時に自動ダウンロードされました)
■silveroxides/Z3D-E621-Convnext
https://huggingface.co/silveroxides/Z3D-E621-Convnext
ただ、wd14-tagger経由ではありませんが、より新しいモデルも利用できるようです。
■Pony系LoRAのタグ出しと編集について|ぽんつく
https://note.com/pontuku/n/n710af3c5c686
なお、Danbooruタグとe621タグの両方で学習させたかったので、前者は「wd-EVA02-Large-v3」で、後者は「Z3D-E621-Convnext」で、それぞれタグ付けファイルを出力しました。その上で、両ファイルを結合しています。
この結合手順は手間なので、LLM(例:ChatGPT)に簡易的なスクリプトを書いて貰っています。最近では、単純なコンピューター作業は、同様にコード生成して貰っています。
```
PowerShellで、2つの指定フォルダに同名のCSVファイル(拡張子は.txt、中身は1行のみ)がある場合、フォルダ1内の各ファイルに対して、フォルダ2の同名ファイルの中身を「, 」で区切って結合・上書き保存するスクリプトを作成してください。
# 条件:
* ヘッダーは無し
* カンマの後に**半角スペース**を入れて結合
* 結合結果はフォルダ1内のファイルに上書き
```
↓
```powershell
# フォルダのパスを指定
$folder1 = "C:\Path\To\Folder1"
$folder2 = "C:\Path\To\Folder2"
# フォルダ1のすべての .txt ファイルを処理
Get-ChildItem -Path $folder1 -Filter "*.txt" | ForEach-Object {
$file1 = $_
$file2Path = Join-Path -Path $folder2 -ChildPath $file1.Name
# フォルダ2に同名のファイルが存在するか確認
if (Test-Path $file2Path) {
# 両方のファイルの内容を取得(1行のみ)
$content1 = Get-Content -Path $file1.FullName -TotalCount 1
$content2 = Get-Content -Path $file2Path -TotalCount 1
# 内容を「, 」で結合し、フォルダ1のファイルに上書き
$mergedContent = "$content1, $content2"
Set-Content -Path $file1.FullName -Value $mergedContent
}
}
```
※この記事に限らずチャンネル全体での事ですが、プロンプトやコードはあくまでも参考例です。それらを使用する場合は、自己責任で行って下さい。その為、それらの内容で理解できていない点がある場合は、それらを使わない事を強く推奨します。
■PowerShell 使い方メモ #Windows - Qiita
https://qiita.com/opengl-8080/items/bb0f5e4f1c7ce045cc57
タグ付けファイルの編集方法としては、引き続き「Dataset Tag Editor」を使用してタグ削除しています。この時、e621タグに対しては人間種である旨のタグ(例:humanoid focus)を削除しないと、ケモ属性が付与される傾向を感じました。
■toshiaki1729/stable-diffusion-webui-dataset-tag-editor
https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor/blob/main/README-JP.md
ここからは余談ですが、生成例の画像のように明確なコマ割りをしたい場合は、次のようなノイズ画像(GIMPの場合は適当な画像に対して「フィルター > ノイズ > 拡散」)を用意し、そこからimg2img(Denoising Strength:0.65前後)すると上手くいく傾向を感じます。画像生成AIにおいて、直線はimg2img後も残りやすい傾向があるようです。
また、LoRAモデルには学習先の画像生成モデルと教師画像との"差分"を学習させている点(厳密には「LoRAモデルには、元のモデルのパラメータを維持しつつ、教師画像に適応するための変化を学習させている」)を意識すると、より良いLoRAモデルの作成に寄与できると思われます。
この記事の例で言えば、キャラクター属性をその差分にしようとしています。
あなたの理想とするキャラクターの姿を画像生成AIに提案してもらい、そこから理想のキャラクターを創りあげて、そしてそのキャラクター画像を再現できるようにする。
これは全年齢対象の分野でも使えるノウハウと思いますので、覚えておいて損はないと考えます。
あなたのオリキャラ作品をお待ちしております。
```
Dance sensuously.
```
(おわり)