adds new Kazusa LoRA
Browse files- kazusa/README.md +51 -0
- kazusa/chara-kazusa-v1c.safetensors +3 -0
- kazusa/example-001-v1c-16dim.png +3 -0
- kazusa/example-002-v1c-16dim.png +3 -0
- kazusa/example-003-v1c-16dim.png +3 -0
- kazusa/example-004-v1c-16dim.png +3 -0
- kazusa/example-005-v1c-16dim.png +3 -0
- kazusa/example-006-v1c-16dim.png +3 -0
- kazusa/example-007-v1c-16dim.png +3 -0
- kazusa/lora_chara_kazusa_v1c_280i7r.json +62 -0
- kazusa/tagging methodology.md +88 -0
kazusa/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Kyoyama Kazusa (Blue Archive)
|
2 |
+
杏山カズサ (ブルーアーカイブ) / 쿄야마 카즈사 (블루 아카이브) / 杏山和纱 (碧蓝档案)
|
3 |
+
|
4 |
+
[**Download here.**](https://huggingface.co/khanon/lora-training/blob/main/kazusa/chara-kazusa-v1c.safetensors)
|
5 |
+
|
6 |
+
## Table of Contents
|
7 |
+
- [Preview](#preview)
|
8 |
+
- [Usage](#usage)
|
9 |
+
- [Training](#training)
|
10 |
+
- [Revisions](#revisions)
|
11 |
+
|
12 |
+
## Preview
|
13 |
+
![Kazusa portrait](chara-haruka-v1c.png)
|
14 |
+
![Kazusa preview 1](example-001-v1c-16dim.png)
|
15 |
+
![Kazusa preview 2](example-002-v1c-16dim.png)
|
16 |
+
![Kazusa preview 3](example-003-v1c-16dim.png)
|
17 |
+
![Kazusa preview 4](example-004-v1c-16dim.png)
|
18 |
+
![Kazusa preview 6](example-006-v1c-16dim.png)
|
19 |
+
|
20 |
+
## Usage
|
21 |
+
- Use any or all of the following tags to summon Kazusa: `kazusa, 1girl, animal ears, colored inner hair, halo, short hair`
|
22 |
+
- For her normal outfit: `black choker, black jacket, black pantyhose, green sailor collar, hooded jacket, white skirt, miniskirt, hairclip, pink neckerchief, school uniform, sneakers`
|
23 |
+
- For a closed jacket, you might need to add `open jacket, white shirt` to the negative prompt.
|
24 |
+
- For raised hood: `hood up`
|
25 |
+
- For her "trying to look cool" expression: `expressionless, blush, sweatdrop, v-shaped eyebrows, embarrassed`
|
26 |
+
- For selfies: `selfie, (reaching towards viewer:1.2)`
|
27 |
+
- For eating: `eating, :t, holding food, food on face`
|
28 |
+
- Accessories: `macaron, cake, fork`
|
29 |
+
|
30 |
+
## Training
|
31 |
+
*Exact parameters are provided in the accompanying JSON files.*
|
32 |
+
- Trained on a set of 280 images.
|
33 |
+
- 7 repeats
|
34 |
+
- 3 batch size, 4 epochs
|
35 |
+
- `(280 * 7) / 3 * 4` = 2614 steps
|
36 |
+
- Kazusa has a lot of good art so her dataset is much larger than usual. This seems to have let me train for longer without overfitting.
|
37 |
+
- 0.08 loss
|
38 |
+
- Initially tagged with WD1.4 swin-v2 model. Tags pruned/edited for consistency.
|
39 |
+
- [Detailed tagging methodology here.](tagging%20methodology.md)
|
40 |
+
- `constant_with_warmup` scheduler
|
41 |
+
- 1.5e-5 text encoder LR
|
42 |
+
- 1.5e-4 unet LR
|
43 |
+
- 1e-5 optimizer LR
|
44 |
+
- Used network_dimension 128 (same as usual) / network alpha 128 (default)
|
45 |
+
- Resized to 16 after training
|
46 |
+
- Training resolution 832x832.
|
47 |
+
- Trained without VAE.
|
48 |
+
|
49 |
+
## Revisions
|
50 |
+
- v1c (2023-03-02)
|
51 |
+
- Initial release.
|
kazusa/chara-kazusa-v1c.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:54ab8df42e151b882ec674b2127e7040c769f7bf99fc0d58c7c172cacfeacb5b
|
3 |
+
size 19007600
|
kazusa/example-001-v1c-16dim.png
ADDED
Git LFS Details
|
kazusa/example-002-v1c-16dim.png
ADDED
Git LFS Details
|
kazusa/example-003-v1c-16dim.png
ADDED
Git LFS Details
|
kazusa/example-004-v1c-16dim.png
ADDED
Git LFS Details
|
kazusa/example-005-v1c-16dim.png
ADDED
Git LFS Details
|
kazusa/example-006-v1c-16dim.png
ADDED
Git LFS Details
|
kazusa/example-007-v1c-16dim.png
ADDED
Git LFS Details
|
kazusa/lora_chara_kazusa_v1c_280i7r.json
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"pretrained_model_name_or_path": "G:/sd/repo/models/Stable-diffusion/nai-animefull-final-pruned.safetensors",
|
3 |
+
"v2": false,
|
4 |
+
"v_parameterization": false,
|
5 |
+
"logging_dir": "",
|
6 |
+
"train_data_dir": "G:/sd/training/datasets/kazusa/dataset",
|
7 |
+
"reg_data_dir": "",
|
8 |
+
"output_dir": "G:/sd/lora/trained/chara/kazusa",
|
9 |
+
"max_resolution": "832,832",
|
10 |
+
"learning_rate": "1e-5",
|
11 |
+
"lr_scheduler": "constant_with_warmup",
|
12 |
+
"lr_warmup": "5",
|
13 |
+
"train_batch_size": 3,
|
14 |
+
"epoch": "4",
|
15 |
+
"save_every_n_epochs": "",
|
16 |
+
"mixed_precision": "fp16",
|
17 |
+
"save_precision": "fp16",
|
18 |
+
"seed": "31337",
|
19 |
+
"num_cpu_threads_per_process": 32,
|
20 |
+
"cache_latents": true,
|
21 |
+
"caption_extension": ".txt",
|
22 |
+
"enable_bucket": true,
|
23 |
+
"gradient_checkpointing": false,
|
24 |
+
"full_fp16": false,
|
25 |
+
"no_token_padding": false,
|
26 |
+
"stop_text_encoder_training": 0,
|
27 |
+
"use_8bit_adam": false,
|
28 |
+
"xformers": true,
|
29 |
+
"save_model_as": "safetensors",
|
30 |
+
"shuffle_caption": true,
|
31 |
+
"save_state": false,
|
32 |
+
"resume": "",
|
33 |
+
"prior_loss_weight": 1.0,
|
34 |
+
"text_encoder_lr": "1.5e-5",
|
35 |
+
"unet_lr": "1.5e-4",
|
36 |
+
"network_dim": 128,
|
37 |
+
"lora_network_weights": "",
|
38 |
+
"color_aug": false,
|
39 |
+
"flip_aug": false,
|
40 |
+
"clip_skip": 2,
|
41 |
+
"gradient_accumulation_steps": 1.0,
|
42 |
+
"mem_eff_attn": false,
|
43 |
+
"output_name": "chara-kazusa-v1c-128",
|
44 |
+
"model_list": "",
|
45 |
+
"max_token_length": "150",
|
46 |
+
"max_train_epochs": "",
|
47 |
+
"max_data_loader_n_workers": "",
|
48 |
+
"network_alpha": 128,
|
49 |
+
"training_comment": "Character: `kazusa, 1girl, animal ears, short hair, colored inner hair, halo`\nStandard outfit: `school uniform, black hooded jacket, hairclip, green sailor collar, white skirt, miniskirt, black pantyhose, sneakers`\nTrying-to-look-cool expression: `blush, expressionless, sweatdrop, v-shaped eyebrows, embarrassed`\nAccessories: `holding food`, `holding fork`, `cake`, `macaron`, `fork`\n\nNot all tags are necessary.\n\n(280 images * 7 repeats) / 3 batch size * 4 epochs = 2614 steps",
|
50 |
+
"keep_tokens": 2,
|
51 |
+
"lr_scheduler_num_cycles": "",
|
52 |
+
"lr_scheduler_power": "",
|
53 |
+
"persistent_data_loader_workers": true,
|
54 |
+
"bucket_no_upscale": true,
|
55 |
+
"random_crop": false,
|
56 |
+
"bucket_reso_steps": 64.0,
|
57 |
+
"caption_dropout_every_n_epochs": 0.0,
|
58 |
+
"caption_dropout_rate": 0,
|
59 |
+
"optimizer": "AdamW8bit",
|
60 |
+
"optimizer_args": "",
|
61 |
+
"noise_offset": ""
|
62 |
+
}
|
kazusa/tagging methodology.md
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Tagging methodology for Kazusa (blue archive)
|
2 |
+
|
3 |
+
Start with WD1.4 Swinv2 at 0.25 confidence.
|
4 |
+
|
5 |
+
- Tag unique features
|
6 |
+
- `halo` / `demon horns` / `low wings`
|
7 |
+
- Remove when not present or out of view. WD1.4 likes putting `halo` even on images where no halo is visible.
|
8 |
+
- Kazusa: `halo` / `animal ears`
|
9 |
+
- Pruned `extra ears` as it seems redundant.
|
10 |
+
- Tag outfit variants with a single master tag
|
11 |
+
- Kazusa:
|
12 |
+
- Uniform: `school uniform` / `black jacket`
|
13 |
+
- Sometimes the jacket appears without anything else, which was not tagged `school uniform`
|
14 |
+
- Non-canon costumes
|
15 |
+
- Add `alternate costume`
|
16 |
+
- Nudity (WD1.4 usually does this accurately)
|
17 |
+
- `nude` / `completely nude`
|
18 |
+
- Prune eye colors
|
19 |
+
- Keep tags which describe unusual eye features (`multicolored eyes`, `heterochromia`, `slit pupils`) as they can otherwise be too subtle and inconsistently drawn for the AI to learn
|
20 |
+
- Prune hair colors
|
21 |
+
- This includes `two-toned hair`, `gradiant hair`, etc. The AI learns all of these very consistently without the tags, likely because artists tend to draw them consistently
|
22 |
+
- Partially prune hair styles
|
23 |
+
- Leave key style tags like `twintails`, `ponytail`, `short hair with long locks`.
|
24 |
+
- Prune exceedingly common tags like `bangs` / `sidelocks` / `eyebrows visible through hair` / `hair between eyes`, etc.
|
25 |
+
- Prune length, except for images which differ from the character's usual length
|
26 |
+
- Add `alternate hairstyle` and/or `alternate hair length` for these
|
27 |
+
- Kazusa: `short hair, colored inner hair` -- while I would usually prune these, they're really her only defining hairstyle traits
|
28 |
+
- Fixup hair ornaments
|
29 |
+
- Prune generic `hair ornament` in favor of more specificity
|
30 |
+
- `hairclip` / `black headband` / `hair flower` / `hair ribbon`, etc.
|
31 |
+
- Consolidate tags that have color variants (`headband` >> `black headband`)
|
32 |
+
- Kazusa: `hairclip`
|
33 |
+
- Consolidate outfits
|
34 |
+
- Only tag an item when it is actually visible. If it is only barely visible along the edge of an image, keep in mind it may be cropped during bucketing.
|
35 |
+
- Danbooru's wiki entry for a character often provides a good list of tags commonly used to describe a character's outfits.
|
36 |
+
- Kazusa outfits:
|
37 |
+
- School Uniform
|
38 |
+
- `black choker`
|
39 |
+
- `hooded jacket`
|
40 |
+
- `black jacket`
|
41 |
+
- `green sailor collar`
|
42 |
+
- `pink neckerchief`
|
43 |
+
- `miniskirt`
|
44 |
+
- `pleated skirt`
|
45 |
+
- `white skirt`
|
46 |
+
- `black pantyhose`
|
47 |
+
- `sneakers`
|
48 |
+
- Fixup sleeves
|
49 |
+
- ie. `long sleeves` / `puffy long sleeves` / `detached sleeves`
|
50 |
+
- You only need one, but pick one and be consistent. If sleeves aren't tagged properly the tends to add them inappropriately (such as when prompting for sleeveless outfits or nudity)
|
51 |
+
- Fixup collars
|
52 |
+
- ie. `detached collar` / `collared shirt` / `choker` / etc.
|
53 |
+
- Same deal as sleeves, they tend to appear when unwanted if not consistently tagged according to visibility in the training data.
|
54 |
+
- Fixup clothing state
|
55 |
+
- ie. `open jacket` / `open shirt` / `partially undressed` / `off shoulder`
|
56 |
+
- The tagger is generally pretty good at this.
|
57 |
+
- Tag expressions
|
58 |
+
- WD1.4 rarely tags these, but doing them manually can help the AI reproduce a character's iconic expressions well.
|
59 |
+
- Start by searching for images without one of these, and add them.
|
60 |
+
- `open mouth`
|
61 |
+
- `closed mouth`
|
62 |
+
- `parted lips`
|
63 |
+
- Add less common expressions
|
64 |
+
- `smile` / `light smile` / `:d`
|
65 |
+
- `wavy mouth` / `embarrassed`
|
66 |
+
- `flustered` / `panicked` / `swirly eyes` / `@_@`
|
67 |
+
- `surprised` / `o_o` / `wide-eyed`
|
68 |
+
- `upset` / `annoyed` / `frustrated` / `v-shaped eyebrows`
|
69 |
+
- `naughty face` / `seductive smile`
|
70 |
+
- `smug` / `:3`
|
71 |
+
- `eyes closed` / `one eye closed`
|
72 |
+
- WD1.4 usually gets these for you.
|
73 |
+
- Tag camera angles/composition
|
74 |
+
- `cowboy shot`
|
75 |
+
- `upper body`
|
76 |
+
- `full body`
|
77 |
+
- `portrait`
|
78 |
+
- `cropped torso` / `cropped legs`
|
79 |
+
- `feet out of frame`
|
80 |
+
- `from side` / `from above` / `from below` / `from behind`
|
81 |
+
- Tag iconic poses/actions
|
82 |
+
- ie. `v` / `standing on one leg`
|
83 |
+
- Kazusa
|
84 |
+
- `mouth hold`
|
85 |
+
- `eating`
|
86 |
+
- `macaroon`
|
87 |
+
- Flip through each image and use Hydrus's "related tags" feature to quickly identify important tags that might be missing.
|
88 |
+
- This feature looks at other images with similar tags to provide suggestions.
|