LECO実験

LECO
Stable Diffusion から特定の知識を消去するLoRAを作成することができる。
GitHub:
Zenn の解説記事:

unnnegative-2
ネガティブのワードを LECO で Erase して結果がどうなるのか。
学習したワード
worst quality
low quality
bad aesthetic
oldest
bad anatomy
bad hands
ロス
(これはまあまあな感じのときのロス)
masterpiece, best quality, exceptional, best aesthetic, 1girl,
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
1.0 でも爆散してしまった。
masterpiece, best quality, exceptional, best aesthetic, 1girl,, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewelry, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt,
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
ギリ耐えてる。
マイナスは...?
masterpiece, best quality, exceptional, best aesthetic,, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewelry, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt,
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
-1 (ネガティブのワードをより強く出るようにする) のほうが綺麗になっているように見える。(気のせいかも)
masterpiece, best quality, exceptional, best aesthetic,, 1girl, bangs, bare shoulders, beret, black hair, black shorts, blue hair, bracelet, breasts, buttons, colored inner hair, double-breasted, eyewear removed, green headwear, green jacket, grey eyes, grey sky, hat, jacket, jewelry, long hair, looking at viewer, multicolored hair, neck ring, o-ring, off shoulder, rain, round eyewear, shorts, sidelocks, small breasts, solo, sunglasses, wavy hair, wet, zipper,
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
みづらい
プロンプト同上
masterpiece, best quality, exceptional, best aesthetic,, 1girl, cat ears, blue hair, high ponytail, parted bangs, white shirt, dress shirt, trench coat, cowboy shot, looking at viewer, cowboy shot, fantasy atmosphere, dark alley, narrow street
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
:thinking:

anti_masterpiece
マスピを吹き飛ばそうの会
ワード
masterpiece
best quality
high quality
exceptional
best aesthetic
newest
結果は後ほど

本来の想定では、 1.0強度ではmasterpiece, best quality,... が一切効かなくなってクオリティが下がり、-1.0ではめちゃくちゃマスピになる予定だったが....
非常に謎な結果....

cat_ears_2
強制オールウェイズ猫耳(にしたい)
1girl
← 1girl, cat ears
に置き換える学習を行う
ロス (これは5段階でいうとだいたい3~4くらいのロス。5が最高。基準は主観)
結果
masterpiece, best quality, exceptional, best aesthetic, anime, 1girl,, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewelry, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt,
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
強くかけると帽子被っていても猫耳をつけてくれる(もしくは帽子が消える)
masterpiece, best quality, exceptional, best aesthetic, anime, 1girl, school uniform, upper body, smile
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
シンプルなプロンプトであれば結構綺麗に出てくる。

ezbad_1 (easy bad)
ezbad
というワードに worst quality, low quality... 概念を押し込んでみる。
- target: "ezbad"
positive: "worst quality, low quality, bad aesthetic, oldest, old, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry"
unconditional: ""
neutral: ""
action: "enhance"
guidance_scale: 1.0
期待する結果:
ネガティブプロンプトが ezbad
で十分、またはかなりの効果をもつワードとして扱えるようになる

ぜんぜんそうはならなかった
masterpiece, best quality, exceptional, best aesthetic, 1girl
Negative prompt: ezbad, worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
masterpiece, best quality, exceptional, best aesthetic, ezbad, 1girl
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
意味がわからない。
手が出てきているのは意味不明。なんでこうなるのかまったくわからない。
学習した中で手の要素は
bad hands, missing fingers, extra digit, fewer digits,
これぐらいしかないのだが、本来これらは消去される予定だったが、なにをしてもこれが出てくるように学習されてしまった...???

ezgood_1 (easy good)
というわけで、先程 enhance したが今回は erase してみる。
期待する結果は、ポジティブに ezgood
を含めるとネガティブプロンプトの代わりになること。
実際の結果
masterpiece, best quality, exceptional, best aesthetic, 1girl
Negative prompt: ezgood, worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
一応クオリティは上がったのだが、やはりネガティブプロンプトは普通に必要...
また、ポジティブに ezgood がなくてもある程度の効果が発生してしまっている。

メモ
-
unreal_4_600
-
unreal_4_last (1000) こっちのがいい
-
ezgood_2_400 でよい

unreal_masterpiece_1
WD1.5 は実写も出せるので、masterpiece やら exceptional を指定すると実写化してしまいやすい問題がある。
そのため、 masterpiece などのクオリティタグから real life, instagram 属性を消去することを試した。
- target: "masterpiece, best quality, exceptional, best aesthetic, newest"
positive: "masterpiece, best quality, exceptional, best aesthetic, newest, real life, instagram"
unconditional: "masterpiece, best quality, exceptional, best aesthetic, newest"
neutral: "masterpiece, best quality, exceptional, best aesthetic, newest"
action: "erase"
guidance_scale: 1.0
期待する結果
masterpiece,.... を使っても実写になりにくくなる。
実際の結果
masterpiece, best quality, exceptional, best aesthetic, 1girl
Negative prompt: bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry, worst quality, low quality, bad aesthetic, oldest
期待通りの結果となってくれた。
強度を上げてみる
masterpiece, best quality, exceptional, best aesthetic, 1girl, cat ears, looking at viewer,
Negative prompt: bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry, worst quality, low quality, bad aesthetic, oldest
アニメ~になってくれた。
マイナスにしてみる。
masterpiece, best quality, exceptional, best aesthetic, 1girl, cat ears, looking at viewer,
Negative prompt: bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry, worst quality, low quality, bad aesthetic, oldest
素晴らしい。実写になった。
他

anti_fingernails_1
アニメでも指定しないで爪長くなってしまう状況があり、非常に指が尖っていて危険性があるため、これを除去する。(また、尖った靴も同様だが、ここではとりあえずネイルを爆破したい)
- target: "nail polish"
positive: "nail polish"
unconditional: ""
neutral: ""
action: "erase"
guidance_scale: 1.0
- target: "long fingernails"
positive: "long fingernails"
unconditional: ""
neutral: ""
action: "erase"
guidance_scale: 1.0
- target: "nail polish, long fingernails"
positive: "nail polish, long fingernails"
unconditional: ""
neutral: ""
action: "erase"
guidance_scale: 1.0
期待する結果としては、nail polish を指定してもでてこない、また、特に何も指定してない状態でも出てこないでくれるようになる。

結果
masterpiece, best quality, exceptional, best aesthetic, 1girl
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
なんだかネイル以上に実写の概念も巻き込んだようだ。
masterpiece, best quality, exceptional, best aesthetic,, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewelry, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt,
Negative prompt: worst quality, low quality, bad aesthetic, oldest, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, jpeg artifacts, signature, watermark, username, blurry
悪くない感じ

unreal_5
複数解像度で実写を消去することをtryする

結果
768解像度でも一応アニメにできるようになった。が、より多く学習した400ステップの効果がむしろ逆になってしまっているのが非常に謎。
200~300ステップはしっかりとアニメになっていたので、この2つをマージしてつかうことにした...