khanon commited on
Commit
6506682
β€’
1 Parent(s): 862db6c

adds retrained Koharu LoRA

Browse files
README.md CHANGED
@@ -32,6 +32,11 @@ Here you will find the various LoRAs I've trained, typically of Blue Archive cha
32
  ### Izuna
33
  [Available on old Mega.co.nz repository.](https://mega.nz/folder/SqYwQTRI#GN2SmGTBsV6S4q-L-V4VeA)
34
 
 
 
 
 
 
35
  ### Kokona
36
  [Sunohara Kokona / ζ˜₯εŽŸγ‚³γ‚³γƒŠ / μŠ€λ…Έν•˜λΌ μ½”μ½”λ‚˜ / ζ˜₯εŽŸεΏƒε₯ˆ](https://huggingface.co/khanon/lora-training/blob/main/kokona/README.md)
37
 
 
32
  ### Izuna
33
  [Available on old Mega.co.nz repository.](https://mega.nz/folder/SqYwQTRI#GN2SmGTBsV6S4q-L-V4VeA)
34
 
35
+ ### Koharu
36
+ [Shimoe Koharu / δΈ‹ζ±Ÿγ‚³γƒγƒ« / μ‹œλͺ¨μ— μ½”ν•˜λ£¨ / δΈ‹ζ±Ÿε°ζ˜₯](https://huggingface.co/khanon/lora-training/blob/main/koharu/README.md)
37
+
38
+ [![Koharu](koharu/chara-koharu-v3.png)](https://huggingface.co/khanon/lora-training/blob/main/koharu/README.md)
39
+
40
  ### Kokona
41
  [Sunohara Kokona / ζ˜₯εŽŸγ‚³γ‚³γƒŠ / μŠ€λ…Έν•˜λΌ μ½”μ½”λ‚˜ / ζ˜₯εŽŸεΏƒε₯ˆ](https://huggingface.co/khanon/lora-training/blob/main/kokona/README.md)
42
 
koharu/README.md CHANGED
@@ -1,60 +1,57 @@
1
  # Shimoe Koharu (Blue Archive)
 
2
 
3
- Changed training methodology around for Koharu. It took way more time and effort due to the degree of manual tagging involved, but it turned out pretty well.
4
 
5
- I'll probably return to this one later to make further improvements now that I've got a much better handle on the impact of tagging and how to get the most out of larger datasets. I don't expect to manual tag every future student, though.
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  ## Usage
8
- Use any or all of these tags to summon Koharu:
9
- `koharu, 1girl, halo, pink eyes, ringed eyes, head wings, low wings, pink hair`
10
- Unlike previous LoRAs, the character's name does help this one somewhat. You can probably omit her hair to save tokens.
11
 
12
- The vertical line running down her body appears consistently, but may not always reach past her chest because artists are inconsistent in how they draw it. You can try to describe it literally: "vertical black line running past navel" or whatever. Don't try `tattoo` unless you want womb tattoos.
13
 
14
  It does a decent, but not perfect job with her eyes. Adding some combination of `embarrassed`, `open mouth`, `swirly eyes` with varying degrees of emphasis can draw out her characteristic horny retard look.
15
 
16
  I tried to add the slit pupils expression and the model sorta gets it, but not very well. You can prompt it with `slit pupils` and `flustered` but it generally creates abominations.
17
 
18
- For her normal Trinity outfit:
19
- `school uniform, off shoulder, hat, skirt`
20
-
21
- Some of her swimsuits are in there too.
22
-
23
- Weights from 0.8 - 1.05 should work well.
24
-
25
- ### Important
26
- This LoRA may be more aggressive than others in forcing a close-up/portrait camera. I believe this is because I scraped Booru tags for this one, and WD1.4 more reliably tags camera angles and image composition than human taggers. You can mitigate this by always prompting for an angle or composition tag, like `above waist` or `cowboy shot` or `from above`. You can combine them, too.
27
-
28
- Trying to prompt Koharu from behind or the side generally doesn't work very well -- it can render her back if you use `from behind` and `back focus`, but her wings will be attached to her stomach and her halo will be flipped,because the AI doesn't know how to generalize those traits to different angles and there's not enough training data for them.
29
 
30
  ## Training
31
- *All parameters are provided in the accompanying JSON files.*
32
-
33
- Koharu's training was handled substantially differently.
34
-
35
- - Trained on a heavily curated set of 183 images, most repeated 6 times. 1150 total steps.
36
- - Dataset included a mixture of SFW and NSFW.
37
- - Doubled the number of steps because the dataset was larger than usual. I typically target 450 - 650.
38
- - New tagging methodology. No WD1.4 tags; instead I scraped tags from Sankaku Complex using Hydrus and manually cleaned them up.
39
- - Removed tons of shit tags
 
40
  - Made sure important traits were present and consitently described, and traits like `halo` were consistent with actual visibility
41
  - Pruned lots of redundant tags and simplified outfits. There is no `black serafuku, long sleeves`, only Koharu's `school uniform`.
42
  - Added camera angles and image composition hints
43
  - Added facial expressions (particularly `embarrassed`) and unusual pupils when present
44
- - Different learning rate than usual.
45
- - 5e-5 text encoder (typically 1e-5 ~ 2e-5)
46
- - 2e-4 UNet (typically one order of magnitude faster than text)
47
- - This was experimental -- human tags tend to be more varied, allowing for more expressiveness (WD1.4 did not do a good job with her) but potentially requiring more training. The dataset was also larger.
48
- - VAE removed. I usually train the dataset on the NAI VAE but after some tests, I think this was leading to oversaturated outputs and it does not play nicely with alternative VAEs.
49
- - May offer a No VAE and a WD1.4 VAE in the future as these seem to present the best results across many configurations
50
-
51
- While I think the experimental things I tried out with this dataset worked out well enough to be called a success, tag cleanup took literal hours and I will probably not be able to put nearly so much effort into every character. I just really like Koharu. I will probably retrain some old ones with at least the new hyperparameter methodologies, though.
52
-
53
- ## To-do
54
- - More consistently tag NSFW/SFW/nudity
55
- - Add more image composition/camera angle tags
56
- - Find additional images with prominent swirly eyes
57
- - Improve tags for socks/shoes
58
- - Remove `halo` tag from images where it is just barely visible to force camera to pull further away
59
- - Un-fuck wings from side angle (folded wings tag?)
60
- - Add `looking away` / `facing away` to applicable images because it is impossible
 
1
  # Shimoe Koharu (Blue Archive)
2
+ δΈ‹ζ±Ÿγ‚³γƒγƒ« (ブルーをーカむブ) / μ‹œλͺ¨μ— μ½”ν•˜λ£¨ (블루 μ•„μΉ΄μ΄λΈŒ) / δΈ‹ζ±Ÿε°ζ˜₯ (θ”šθ—ζͺ”ζ‘ˆ)
3
 
4
+ Note: this is an older LoRA that I recently retrained. I think the quality of the captions is lacking and as such this LoRA doesn't perform quite as well as it should. I'll re-tag the dataset when I have time.
5
 
6
+ [Download here.](chara-koharu-v3.safetensors)
7
+
8
+ ## Table of Contents
9
+ - [Preview](#preview)
10
+ - [Usage](#usage)
11
+ - [Training](#training)
12
+ - [Revisions](#revisions)
13
+
14
+ ## Preview
15
+ ![Koharu portrait](chara-koharu-v3.png)
16
+ ![Koharu preview](example-001-DefmixRed-v3.png)
17
+ ![Koharu preview 2](example-002-DefmixRed-v3.png)
18
 
19
  ## Usage
20
+ Use any or all of the following tags to summon Koharu: `koharu, 1girl, halo, pink eyes, ringed eyes, head wings, low wings, pink hair, blue archive`
21
+ - Hair and eye tags are optional.
22
+ - The vertical line should appear automatically, but may not always reach past her chest because artists are inconsistent in how they draw it. You can try to describe it literally: `vertical black line running past navel` or whatever. Don't try `tattoo` unless you want womb tattoos.
23
 
24
+ For her normal Trinity outfit: `school uniform, off shoulder, hat, skirt`
25
 
26
  It does a decent, but not perfect job with her eyes. Adding some combination of `embarrassed`, `open mouth`, `swirly eyes` with varying degrees of emphasis can draw out her characteristic horny retard look.
27
 
28
  I tried to add the slit pupils expression and the model sorta gets it, but not very well. You can prompt it with `slit pupils` and `flustered` but it generally creates abominations.
29
 
30
+ Some of her swimsuits are in the training data, too.
 
 
 
 
 
 
 
 
 
 
31
 
32
  ## Training
33
+ *Exact parameters are provided in the accompanying JSON files.*
34
+ - Trained on a set of 183 images; 170 normal, 13 slit pupils/flustered.
35
+ - 4 repeats for normal
36
+ - 5 repeats for flustered expression outfit
37
+ - 3 batch size, 7 epochs
38
+ - `(170*4 + 13*5) / 3 * 7` = 1739 steps
39
+ - 832x832 training resolution
40
+ - `constant_with_warmup` scheduler
41
+ - Initially tagged using scraped Danbooru tags, then heavily edited.
42
+ - Removed many shit/inaccurate tags
43
  - Made sure important traits were present and consitently described, and traits like `halo` were consistent with actual visibility
44
  - Pruned lots of redundant tags and simplified outfits. There is no `black serafuku, long sleeves`, only Koharu's `school uniform`.
45
  - Added camera angles and image composition hints
46
  - Added facial expressions (particularly `embarrassed`) and unusual pupils when present
47
+ - Used network_dimension 128 (same as usual) / network alpha 128 (default)
48
+ - Trained without VAE.
49
+ - [Training dataset available here.](https://mega.nz/folder/Wi4jRZbJ#OHhH-qsltCEbks3GF2gqmg)
50
+
51
+ ## Revisions
52
+ - v3 (2023-02-11)
53
+ - Re-trained with more recent parameters. No changes to dataset.
54
+ - Still overfit to her standard outfit. Needs re-tagging.
55
+ - v2 (2023-01-15)
56
+ - Initial release.
57
+ - [Old version can be downloaded here.](https://mega.nz/folder/Wi4jRZbJ#OHhH-qsltCEbks3GF2gqmg)
 
 
 
 
 
 
koharu/{00337-4289014929.png β†’ chara-koharu-v3.png} RENAMED
File without changes
koharu/{example-003-v2.png β†’ chara-koharu-v3.safetensors} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1258a8c61ecad917c730f013cd6f57fa752a425f1e08b78d60f2958e1375b85a
3
- size 2267393
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:290039bfc75cd18e269e4ffdd4b3bc31a4d39c7fbfb38d9507059133ade725ca
3
+ size 151132730
koharu/{example-001-v2.png β†’ example-001-DefmixRed-v3.png} RENAMED
File without changes
koharu/{example-002-v2.png β†’ example-002-DefmixRed-v3.png} RENAMED
File without changes
koharu/example-004-v2.png DELETED

Git LFS Details

  • SHA256: 45159a620dba4e945b698d747a5fe7f7830a2df9092508c5c158be597bbb1c0c
  • Pointer size: 132 Bytes
  • Size of remote file: 1.62 MB
koharu/{lora_character_koharu_v2_180i6r-split_832_batch3_5e-5text_2e-4unet_3epoch.json β†’ lora_chara_koharu_v3_183i4r.json} RENAMED
@@ -3,21 +3,22 @@
3
  "v2": false,
4
  "v_parameterization": false,
5
  "logging_dir": "",
6
- "train_data_dir": "G:/sd/training/datasets/koharu",
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
- "lr_scheduler": "cosine_with_restarts",
 
11
  "lr_warmup": "5",
12
  "train_batch_size": 3,
13
- "epoch": "3",
14
- "save_every_n_epochs": "1",
15
  "mixed_precision": "fp16",
16
  "save_precision": "fp16",
17
  "seed": "31337",
18
  "num_cpu_threads_per_process": 32,
19
- "cache_latent": true,
20
- "caption_extention": ".txt",
21
  "enable_bucket": true,
22
  "gradient_checkpointing": false,
23
  "full_fp16": false,
@@ -30,8 +31,8 @@
30
  "save_state": false,
31
  "resume": "",
32
  "prior_loss_weight": 1.0,
33
- "text_encoder_lr": "5e-5",
34
- "unet_lr": "2e-4",
35
  "network_dim": 128,
36
  "lora_network_weights": "",
37
  "color_aug": false,
@@ -39,5 +40,15 @@
39
  "clip_skip": 2,
40
  "gradient_accumulation_steps": 1.0,
41
  "mem_eff_attn": false,
42
- "output_name": "koharu-v2-NoVAE"
 
 
 
 
 
 
 
 
 
 
43
  }
 
3
  "v2": false,
4
  "v_parameterization": false,
5
  "logging_dir": "",
6
+ "train_data_dir": "G:/sd/training/datasets/koharu/dataset",
7
+ "reg_data_dir": "",
8
+ "output_dir": "G:/sd/lora/trained/koharu",
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": "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-koharu-v1",
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: `koharu, 1girl, halo, pink eyes, ringed eyes, head wings, low wings, pink hair`\nStandard outfit: `school uniform, off shoulder, hat, skirt`\nExpression: `embarrassed, open mouth, swirly eyes, @_@`\n(170 normal * 4 repeats + 13 flustered * 5 repeats) / 3 batch size * 7 epochs = 1738 steps",
50
+ "keep_tokens": 2,
51
+ "lr_scheduler_num_cycles": "",
52
+ "lr_scheduler_power": "",
53
+ "persistent_data_loader_workers": true
54
  }
koharu/lora_character_koharu_v1_158i5r_768_batch3_5e-5text_1.5e-4unet_3epoch.json DELETED
@@ -1,43 +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/koharu",
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
- "lr_scheduler": "cosine_with_restarts",
11
- "lr_warmup": "5",
12
- "train_batch_size": 3,
13
- "epoch": "3",
14
- "save_every_n_epochs": "1",
15
- "mixed_precision": "fp16",
16
- "save_precision": "fp16",
17
- "seed": "31337",
18
- "num_cpu_threads_per_process": 32,
19
- "cache_latent": true,
20
- "caption_extention": ".txt",
21
- "enable_bucket": true,
22
- "gradient_checkpointing": false,
23
- "full_fp16": false,
24
- "no_token_padding": false,
25
- "stop_text_encoder_training": 0,
26
- "use_8bit_adam": true,
27
- "xformers": true,
28
- "save_model_as": "safetensors",
29
- "shuffle_caption": true,
30
- "save_state": false,
31
- "resume": "",
32
- "prior_loss_weight": 1.0,
33
- "text_encoder_lr": "5e-5",
34
- "unet_lr": "1.5e-4",
35
- "network_dim": 128,
36
- "lora_network_weights": "",
37
- "color_aug": false,
38
- "flip_aug": false,
39
- "clip_skip": 2,
40
- "gradient_accumulation_steps": 1.0,
41
- "mem_eff_attn": false,
42
- "output_name": "koharu-v1-NoVAE"
43
- }