khanon commited on
Commit
a294452
1 Parent(s): 20c8678

adds retrained Mari LoRA

Browse files
README.md CHANGED
@@ -31,7 +31,9 @@ Here you will find the various LoRAs I've trained, typically of Blue Archive cha
31
  [Available on old Mega.co.nz repository.](https://mega.nz/folder/SqYwQTRI#GN2SmGTBsV6S4q-L-V4VeA)
32
 
33
  ### Mari
34
- [Available on old Mega.co.nz repository.](https://mega.nz/folder/SqYwQTRI#GN2SmGTBsV6S4q-L-V4VeA)
 
 
35
 
36
  ### Michiru
37
  [Available on old Mega.co.nz repository.](https://mega.nz/folder/SqYwQTRI#GN2SmGTBsV6S4q-L-V4VeA)
 
31
  [Available on old Mega.co.nz repository.](https://mega.nz/folder/SqYwQTRI#GN2SmGTBsV6S4q-L-V4VeA)
32
 
33
  ### Mari
34
+ Iochi Mari / 伊落マリー / 이오치 마리
35
+
36
+ [![Mari](mari/chara-mari-v5b.png)](https://huggingface.co/khanon/lora-training/blob/main/mari/README.md)
37
 
38
  ### Michiru
39
  [Available on old Mega.co.nz repository.](https://mega.nz/folder/SqYwQTRI#GN2SmGTBsV6S4q-L-V4VeA)
mari/README.md CHANGED
@@ -1,50 +1,65 @@
1
  # Iochi Mari (Blue Archive)
2
- I used a bigger dataset than normal since Mari has a lot of good art (253 images).
3
 
4
- This was a tricky LoRA to train since she has two very distinct outfits (and her gym outfit has as much art without her jacket as with). The LoRA recalls both outfits, and even her swimsuit, but you may need to negative prompt elements of whichever outfit you don't want.
5
 
6
- ## Usage
7
- Use any or all of these tags to summon Mari:
8
- `mari, halo, 1girl, blue eyes`
9
- `cat ears` was only tagged on images where her cowl was not present, in which case `animal ear headwear` is the tag you want.
10
- Hair and eyes are optional.
11
-
12
- For her normal outfit (you don't usually need all of these):
13
- `single braid, animal ear headwear, nun, habit, puffy long sleeves, blue neckerchief, white sailor collar`
14
- Her shoes were tagged `mary janes`.
15
- The sleeves of her outfit leak into other outfits/nudity so you may need to negative prompt them (`puffy long sleeves`)
16
 
17
- For her gym uniform outfit (you don't usually need all of these):
18
- `low ponytail, sportswear, track jacket, shorts, gym shirt, ponytail, id card, bottle`
19
- Images with her jacket visible were tagged `track jacket`. If the jacket was open, I added `open jacket`.
20
- Images with her gym shirt visible (so not those where her jacket was closed) were tagged `gym shirt`. Adding `white` can help.
21
- `wet, wet clothes` was common in the trianing data and works well.
22
 
23
- For her swimsuit (only a handful of images in the training data, so use emphasis):
24
- `black one-piece swimsuit, frilled swimsuit, frills, paw print`
25
- Negative prompt: `competition swimsuit`
 
 
26
 
27
- Included three epochs. I did way more steps than normal in pursuit of perfect halo gens,
28
- - epoch 7 (3542 steps) = nails her expressions and outfits pretty well but outfit details can leak over. best halo but still not great
29
- - epoch 6 (~3000 steps) = pretty good balance between the others
30
- - epoch 4 (~2000 steps) = less overfit on outfits but halo and expression consistency is not as good
31
 
32
- Weight 1 works fine for the most part. Epoch 7 may be somewhat stubborn/overfit on some parts of her outfit, in which case you may have better luck dropping down to epoch 6 or 4.
 
 
 
33
 
 
 
34
 
35
  ## Training
36
- *All parameters are provided in the accompanying JSON files.*
37
- - Trained on a set of 253 images repeated 6 times, 7 epochs (253 images * 6 repeats / 3 batch size * 7 epochs = 3542 steps)
38
- - Dataset included a mixture of SFW and NSFW.
39
- - Same params as Koharu, but with almost double the amount of steps, since the dataset was large and I wasn't initially satisfied with halo/facial expression consistency
40
- - Initially tagged with WD1.4, then performed heavy pruning and editing.
41
- - Pruned redundant tags and simplified outfits so that they were always tagged with the same handful of tags
42
- - Made sure important traits were present and consitently described, and traits like `halo` were consistent with actual visibility
43
- - Added many facial expression, camera angle, and image composition hints
44
- - Made a hard-coded tweak to bmaltais's LoRA GUI script.
45
- - Previously increasing the `resolution` values (512 >> 768 >> 832) would not increase `max_bucket_reso`, so buckets were limited to 1024 (the default) in either dimension.
46
- - Per the kohya_ss README, when increasing `resolution` to 768, it is recommended to increase `max_bucket_reso` to 1280 to keep the bucket aspect ratios the same as 512 resolution
47
- - I adjusted the script to set `max_bucket_reso` based on `resolution`, using the formula:
48
- - `max_bucket_reso = resolution * (1 + (512 / resolution))` which causes bucket aspect ratios to be the same as 512 for any given resolution.
49
- - In practice, this only affected a very small number of very tall or very wide images so I don't think it would have made much of a difference
50
  - Trained without VAE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Iochi Mari (Blue Archive)
2
+ 伊落マリー (ブルーアーカイブ) / 이오치 마리 (블루 아카이브)
3
 
4
+ [**Download here.**](chara-mari-v5b.safetensors)
5
 
6
+ ## Table of Contents
7
+ - [Preview](#preview)
8
+ - [Usage](#usage)
9
+ - [Training](#training)
10
+ - [Revisions](#revisions)
11
+ - [Alternate Version](#alternate-version---v4)
 
 
 
 
12
 
13
+ ## Preview
14
+ ![Mari portrait](chara-mari-v5b.png)
15
+ ![Mari nun](example-001-Treebark-v5b.png)
16
+ ![Mari gym](example-002-AOM2-v5b.png)
17
+ ![Mari dress](example-003-DefmixRed-v5b.png)
18
 
19
+ ## Usage
20
+ Use any or all of the following tags to summon Mari: `mari, halo, 1girl, blue eyes, orange hair`
21
+ - Hair and eyes are optional.
22
+ - It is recommended to add `cat ears` or `animal ear headwear`, otherwise her ears may not appear consistently. This is likely because Mari's veil prevents the AI from strongly associating her ears the word `mari`.
23
+ - If Mari's ears are appearing through her veil, try adding `animal ear fluff` to the negative prompt.
24
 
25
+ For her normal outfit: `single braid, animal ear headwear, nun, habit, blue neckerchief, white sailor collar, puffy long sleeves`
 
 
 
26
 
27
+ For her sportswear alt: `low ponytail, sportswear, track jacket, shorts, gym shirt, ponytail, white headband, id card, bottle`
28
+ - Use `track jacket` for a full jacket, or `open jacket` when the jacket should be open.
29
+ - Use `wet, wet clothes` for transparent/wet clothing
30
+ - Use `gym shirt` to discourage the full jacket from appearing, as it was only tagged when the jacket was unzipped.
31
 
32
+ For her swimsuit: `black one-piece swimsuit, frilled swimsuit, frills, paw print`
33
+ - You will likely need to add `competitions wimsuit` to the negative prompt.
34
 
35
  ## Training
36
+ *Exact parameters are provided in the accompanying JSON files.*
37
+ - Trained on a set of 253 images
38
+ - Datset included a mixture of SFW/NSFW.
39
+ - 3 repeats
40
+ - 3 batch size, 7 epochs
41
+ - `(253*3) / 3 * 7` = 1771 steps
42
+ - Increased steps for stronger fit due to larger, more varied dataset.
43
+ - 768x768 training resolution
44
+ - `constant_with_warmup` scheduler
45
+ - Initially tagged with WD1.4 Convnext model, then heavily edited.
46
+ - Pruned redundant tags and simplified outfit tags such that Mari's outfit was always described with the same words
47
+ - Ensured unique traits such as `halo` were consistent with actual visibility
48
+ - Added many tags for facial expressions, camera angles, and image composition
49
+ - Used network_dimension 128 (same as usual) / network alpha 128 (default)
50
  - Trained without VAE.
51
+ - [Training dataset available here.](https://mega.nz/folder/2uYkWQiA#GlVNAYXubskusIMbrmVOGQ)
52
+
53
+ ## Revisions
54
+ - v5b (2023-02-08)
55
+ - Completely re-trained to correct issue where caption files were not being loaded correctly. New version should have more flexibility but requires additional outfit prompting.
56
+ - v4 (2023-01-20)
57
+ - Initial release.
58
+ - **Issue:** caption files were completely ignored during training. As a result, prompting "sora" grants a very strong effect, but the LoRA is highly overfit.
59
+
60
+ ## Alternate Version - v4
61
+ **v4** is also available. This version was improperly configured and ignored caption files, so it was trained only on the word `mari`. It looks quite good, however it is very overfit and it is difficult to adjust Mari's outfit. In the example image below, the prompt includes `yellow dress` but the model ignores the color and instead uses a dress that resembles Mari's usual outfit.
62
+
63
+ **[Download v4.](v4/chara-mari-v4-epoch7.safetensors)**
64
+
65
+ ![v4 Preview](v4/example-003-DefmixRed-v4.png)
mari/chara-mari-v5b.png ADDED

Git LFS Details

  • SHA256: 7b69b4408495b3f36065ca0f98e21b19c02fbef4e60a3b154ca4197b765c829b
  • Pointer size: 131 Bytes
  • Size of remote file: 468 kB
mari/chara-mari-v5b.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cb3f9d5f5fe82845f1ced4d7236de1bb85ba1deb513e49122e5e3dcc08cd1da
3
+ size 151128976
mari/example-001-Treebark-v5b.png ADDED

Git LFS Details

  • SHA256: 64d7455e0bde359dd5cc11e9ce89435293d2df8951b6bcf443d31a617478402c
  • Pointer size: 132 Bytes
  • Size of remote file: 7.58 MB
mari/example-002-AOM2-v5b.png ADDED

Git LFS Details

  • SHA256: 68e53b7d1dbb97245dc7cd63b079c582157c413cbbc3c37c4a12f93261774d64
  • Pointer size: 132 Bytes
  • Size of remote file: 8.11 MB
mari/example-003-DefmixRed-v5b.png ADDED

Git LFS Details

  • SHA256: b73f8bdfe48ba031bf6fbde8a014d0b3a66d9cbb4f40f87f690e4fec258ff13e
  • Pointer size: 132 Bytes
  • Size of remote file: 7.83 MB
mari/{lora_character_mari_v2_253i6r_768-fixed-max-bucket-reso_batch4_5e-5text_5e-4unet_4epoch.json → lora_chara_mari_v5b_253i3r.json} RENAMED
@@ -3,22 +3,22 @@
3
  "v2": false,
4
  "v_parameterization": false,
5
  "logging_dir": "",
6
- "train_data_dir": "G:/sd/training/datasets/mari",
7
- "reg_data_dir": "G:/sd/training/datasets/regempty",
8
- "output_dir": "G:/sd/repo/extensions/sd-webui-additional-networks/models/lora",
9
  "max_resolution": "768,768",
10
- "learning_rate": "",
11
- "lr_scheduler": "cosine_with_restarts",
12
  "lr_warmup": "5",
13
- "train_batch_size": 4,
14
- "epoch": "5",
15
- "save_every_n_epochs": "1",
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": "",
22
  "enable_bucket": true,
23
  "gradient_checkpointing": false,
24
  "full_fp16": false,
@@ -31,8 +31,8 @@
31
  "save_state": false,
32
  "resume": "",
33
  "prior_loss_weight": 1.0,
34
- "text_encoder_lr": "5e-5",
35
- "unet_lr": "5e-4",
36
  "network_dim": 128,
37
  "lora_network_weights": "",
38
  "color_aug": false,
@@ -40,9 +40,15 @@
40
  "clip_skip": 2,
41
  "gradient_accumulation_steps": 1.0,
42
  "mem_eff_attn": false,
43
- "output_name": "mari-v2-NoVAE",
44
  "model_list": "",
45
  "max_token_length": "150",
46
  "max_train_epochs": "",
47
- "max_data_loader_n_workers": ""
 
 
 
 
 
 
48
  }
 
3
  "v2": false,
4
  "v_parameterization": false,
5
  "logging_dir": "",
6
+ "train_data_dir": "G:/sd/training/datasets/mari/dataset",
7
+ "reg_data_dir": "",
8
+ "output_dir": "G:/sd/lora/trained/chara/mari",
9
  "max_resolution": "768,768",
10
+ "learning_rate": "1e-5",
11
+ "lr_scheduler": "constant_with_warmup",
12
  "lr_warmup": "5",
13
+ "train_batch_size": 3,
14
+ "epoch": "7",
15
+ "save_every_n_epochs": "6",
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,
 
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,
 
40
  "clip_skip": 2,
41
  "gradient_accumulation_steps": 1.0,
42
  "mem_eff_attn": false,
43
+ "output_name": "chara-mari-v5b",
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: `mari, halo, 1girl, orange hair, blue eyes` (hair and eyes optional)\nStandard outfit: `single braid, nun, animal ear headwear, habit, puffy long sleeves, blue neckerchief, white sailor collar`\nGym outfit: `low ponytail, sportswear, cat ears, animal ear fluff, track jacket, shorts, gym shirt, ponytail, id card, bottle`\n253 images * 3 repeats / 3 batch size * 7 epochs = 1771 steps",
50
+ "keep_tokens": 2,
51
+ "lr_scheduler_num_cycles": "",
52
+ "lr_scheduler_power": "",
53
+ "persistent_data_loader_workers": true
54
  }
mari/lora_character_mari_v1_253i8r_832_batch3_5e-5text_2e-4unet_4epoch.json DELETED
@@ -1,48 +0,0 @@
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/mari",
7
- "reg_data_dir": "G:/sd/training/datasets/regempty",
8
- "output_dir": "G:/sd/repo/extensions/sd-webui-additional-networks/models/lora",
9
- "max_resolution": "832,832",
10
- "learning_rate": "",
11
- "lr_scheduler": "cosine_with_restarts",
12
- "lr_warmup": "5",
13
- "train_batch_size": 3,
14
- "epoch": "6",
15
- "save_every_n_epochs": "2",
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": "",
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": true,
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": "5e-5",
35
- "unet_lr": "2e-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": "mari-v3-NoVAE",
44
- "model_list": "",
45
- "max_token_length": "150",
46
- "max_train_epochs": "",
47
- "max_data_loader_n_workers": ""
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mari/lora_character_mari_v3_253i8r_832_batch3_5e-5text_3e-4unet_4epoch.json DELETED
@@ -1,48 +0,0 @@
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/mari",
7
- "reg_data_dir": "G:/sd/training/datasets/regempty",
8
- "output_dir": "G:/sd/repo/extensions/sd-webui-additional-networks/models/lora",
9
- "max_resolution": "832,832",
10
- "learning_rate": "",
11
- "lr_scheduler": "cosine_with_restarts",
12
- "lr_warmup": "5",
13
- "train_batch_size": 3,
14
- "epoch": "4",
15
- "save_every_n_epochs": "3",
16
- "mixed_precision": "fp16",
17
- "save_precision": "fp16",
18
- "seed": "23",
19
- "num_cpu_threads_per_process": 32,
20
- "cache_latents": true,
21
- "caption_extension": "",
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": true,
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": "5e-5",
35
- "unet_lr": "3e-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": "mari-v3-NoVAE",
44
- "model_list": "",
45
- "max_token_length": "150",
46
- "max_train_epochs": "",
47
- "max_data_loader_n_workers": ""
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mari/lora_character_mari_v4_253i6r_832_batch3_5e-5text_2e-4unet_6epoch.json DELETED
@@ -1,48 +0,0 @@
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/mari",
7
- "reg_data_dir": "G:/sd/training/datasets/regempty",
8
- "output_dir": "G:/sd/repo/extensions/sd-webui-additional-networks/models/lora",
9
- "max_resolution": "832,832",
10
- "learning_rate": "",
11
- "lr_scheduler": "cosine_with_restarts",
12
- "lr_warmup": "5",
13
- "train_batch_size": 3,
14
- "epoch": "6",
15
- "save_every_n_epochs": "2",
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": "",
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": true,
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": "5e-5",
35
- "unet_lr": "2e-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": "mari-v4-NoVAE",
44
- "model_list": "",
45
- "max_token_length": "150",
46
- "max_train_epochs": "",
47
- "max_data_loader_n_workers": ""
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mari/v4/chara-mari-v4-epoch7.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fa63a5b21117b75f8a3b92f274392e13f21568e11d31eb0c75bdcc3216afabc
3
+ size 151074586
mari/v4/example-003-DefmixRed-v4.png ADDED

Git LFS Details

  • SHA256: fbcd2fac5c0ef96d9d063e98692729c193033d980c51b5996a1b22c35273624c
  • Pointer size: 132 Bytes
  • Size of remote file: 8.7 MB
mari/{lora_character_mari_v4_253i6r_832_batch3_5e-5text_2e-4unet_7epoch.json → v4/lora_character_mari_v4_253i6r_832_batch3_5e-5text_2e-4unet_7epoch.json} RENAMED
File without changes