santa hat
deerdeer nosedeer glow
Sign In

An Easy Way to Make A Cosplay Lora 简易Cosplay Lora制作法

An Easy Way to Make A Cosplay Lora 简易Cosplay Lora制作法

中文版在后边。

Thanks to the help of l4t and L_A_X.

特别感谢l4t和L_A_X老师的指导。

English ver.

Introduction

Some character's cosplay loras are easy to make as there are lots of cosplay images. But not all characters are so lucky, they even do not have enough images for themselves.

And if you want the lora to learn just the clothes of the character, it turns out that the features of the head are also learned. Especially some small features do not have corresponding tags, making these small features quite difficult to control or remove.

Next, I will introduce a little trick to reduce the learning of the character's head as much as possible.

Take Lila's nightgown as an example.

Preparation

Well I only found 10 pictures. Here I selected more than 2/3 of the number, 7.

20230914: You do not have to cover too many images (actually 1/4 or 1/5 is OK). If you have enough completely nude girls, and the original character's hairstyle is not too unique, it is even unnecessary to cover any face.

Then use tools to cover Lila's face with color blocks.

You may ask: so simple?

Actually it is just that simple, but next, please pay attention: when we use tagger, be sure to tag them with "identity censor" and "faceless".

Otherwise these color blocks will become uncontrollable.

Some other tricks

Some Naked Girls

It is a little bit like regulation. Firstly I put a few pictures of completely naked girls in the datasets - their hair color should be as different as possible from the original characters ( in this case Lila has white hair so these naked girls had better not have white hair), and they should not be censored.

This can help the painting style, hair color and so on to be less overfitting, and make the clothes easier to adjust.

Some Close-Ups

Because there are only 10 images of Lila, we may be afraid that AI can not learn the most important feature well——

So I add some close-up parts, which were took from the original 10 images and were mirrored (this gown is symmetrical).

Beware, these close-ups must be tagged with "head out of frame", and the 3rd one should be tagged with "breast focus".

Go training

Then, delete some tags and arrange the tags so that we can set keep_tokens.

After that, set folders and repeats.

Do not give the "focus" folder too many repeats, or you are more likely to get a head-out-of-frame image with this lora.

As for the parameter of lora training, this nightgown is not very complex, so I just use 16/16 and enable block weight training to make the file smaller.

Finally, test the lora——

Emmm, not bad.

中文版=====================

前言

一些角色的cosplay lora很好做,有很多人cos她们。但不是所有角色都那么幸运,她们甚至自己都没有足够的素材(

如果你想要lora学习这个角色的衣服,结果就会发现头部的特征也被学习了,特别是一些小特征没有对应的tag,导致这些小特征难以控制和去除。
接下来我就介绍一个小技巧,来尽可能地减少对角色头部的学习。

拿莉拉的睡袍举例:

准备

嘛我只能找到10张图,这里我选出2/3以上的数量,也就是7。

20230914: 没必要遮那么多,实际上1/4或1/5就够了。如果你有足够的裸体人,且原角色的发型不是非常特殊,甚至可以一张也不遮。

然后用工具,用色块将莉拉的脸遮挡起来。

你会问,就这么简单?

事实是就这么简单,但接下来,请注意:在我们打标时,务必打上identity censor和faceless。

否则这些色块就会变得不可控。

一些其他小技巧

加点裸女

有点类似正则化。我往数据集里放了几张有全裸妹子的图——她们的发色要尽可能跟原角色不同(在这个例子中莉拉是白发所以这些裸体人最好别也是白发),且不要被打码。

这样能一定程度改善画风和发色等等的过拟问题,同时让这个衣服更容易调整。

加点特写

由于睡袍莉拉就10张图,我们可能会担心AI学不好最关键的特征——

因此我加了几张特写,是从原本的10张图里截出来的并经过了镜像(毕竟这衣服是对称的)。

注意,这几张特写一定要打上"head out of frame"的tag,并且第三张这种应该打上"breast focus"。

开炉

之后删掉一些tag,调整一下tag顺序方便我们设置keep_tokens。

然后设置一下文件夹和repeats。

别给"focus"文件夹太多重复,否则你用这个lora时更有可能得到一个头在画面外的图。

至于训练参数,这个睡袍不是很复杂,所以我就16/16并且开了分层让文件小一些。

最后,开测——

嘛,还不赖。

280

Comments