#kohya_ss Trainer Colab
1 messages · Page 2 of 1
I'm glad to know I'm not clinically insane
yet
shouldnt the folder containing the other folder with repeats be the project name?
oh nvm blind
Has anyone paid for 100 Google Colab compute units? How long does it last training loras via kohya?
if I remember correctly, A100 uses around 13 compute units per hours
it's not that great
regular T4 uses 1 or 2 at max
sadly the A100 is not 10x faster than a T4 so yeah
there are much better alternatives than Colab
for example, at paperspace if you have "Growth" subscription (~50 usd per month), you can use A100-80GB GPUs
one session lasts 6 hours at max, tho you have persistent storage, and also if a session ends, you can restart one immediately without any limitations
you can buy 100 compute units at Google for 12,5 USD, and it is enough for 7.5 hours on an A100 (only 40GB tho), that means that you should use paperspace for at least 30 hours in a month to make it worth more
I'm sure there are other gpu clouds also. Lamda GPU is also a pretty good value, however it is almost always at full capacity
thanks leggeka, I bought the thing and will stick to the T4 so I can use colab more comfortably for now
hi guys im new to lora training and picked the easiest collab i found for now and wanted to ask is there something like best settings or it deepends what data set u have for an example 20-50-100 images wat settings is good to use here?
are you using the Colab in the pinned messages?
or is it Lynn's
anyways, the settings seems good for a baseline
i'm asking because there are some other important parameters like learning rate, or training mode (unet+text encoder, or unet only) which are not in the image
im using this one
other ones look a little bit not for me :lulw:
tried to train about 10 loras but im not getting that good results
ah, well. Lynn's has all the parameters which can be edited during training, it's a more advanced Colab than these. The default values are fine but probably you should change them if you didn't get good results with the simpler Colabs.
Try the pinned one, it has instructions and less things to worry about
i get just weird bodies like its made of dirt
ah that's because you missed your activation word from your prompt
i think mine and hollow's Colab are not training the Textual Encoder part, so it doesn't need activation words
if you apply the lora it just works
the text encoder training part was a bit confusing for me too in Lynn's colab
I tought it wasnt was necessary to
I had text encoder at 5e-5 on mine, today I made it so you can change it if you want. Most of the settings say "leave as is if you're not sure"
is it ok if i use small data set like 20-30 images
it's fine
some with full body pics other portraits
yes
so i should try both of ur colabs 😅 ok
Mine is just a cleaner version of legekka's, props to him
yeah you should use hollow's from the pinned message
Also I fixed the xformers with the help of some guy
I think it's faster now
Just had to change one line cause the dependencies changed at some point
you don't want to know how many builds did I make...
it's definitely faster with xformers
also it will be even faster with PyTorch 2.0 and model compile
5 days left until release \o/
does anyone know why it defaulted to dreambooth method even if i had nothing on the reg folder?
btw
it's deprecated
no, if you have buckets enabled (which is enabled by default if I remember correctly), it will resize all of them
alright im gonna start now training my lora
should i go with default settings for first run or change something
my data set is from 20 images
so does it mean its ok to let it go with 10 or should i higher the number
depends on what youre training
style or character
also how many repeats have you set on the folder
character
and i didnt set any repeats
thats the thing i dont see here any data set repeats
on the last colab i used there was a setting how many times i should repeat my data set
you set the repeats by renaming the folder of the images
i see i see my bad for not reading
so i create a folder with project name and create another folder in it and i rename it to xx_repetiotions
alright so how many repeats should i put on my data set with the 20 images for an example any idea what i should try first
you can name it anything you want just needs the number and underscore at the beginning
Ok for 20 images I'd recommend 10 repeats and 10 epochs
Every other setting stays the same
Try that, should be like 15 minutes, if it doesn't work try more repeats or unet 1e-3
watt i used to wait 1 hour or so kekw
lora training meant to be "fast"
alright brb when training is done
20x10x10/2 is 100 steps per epoch, 1000 steps total.
1000 to 2000 works well for characters
I just did 6600 steps at 1e-4 unet for a style
for styles you kinda just need to eyeball it
depends a lot on your dataset, lr and netdim
just make sure its not overbaked/overfit
at least you can play around with the settings and you don't have to wait 4 hours in between
A videogame
600 images
what dim/alpha and lr did you go for?
ill give it a try later
i might retrain my mimonel lora again so i kinda want to do it with better lr as that one was trained on like week one of the lora training days
For this one I went with 1e-4 unet, 0 text encoder, 32/16 dim/alpha, 600 images, 1 repeat, 30 epochs
yeah i see 128/128 was abandoned long ago huh?
128 is cringe
do you feel like bigger dim like 64 that i heard helps at all?
you can train a universe into 128
Probably not, I just went with 32 here because it was my first style, for characters I do 16
I saw a dim 1 style and it worked fine
ive been training multiple outfits/characters lora and 128 dim got the best details but i guess it might only be decent for there and might also be overkill
any reason for text encoder at 0 as well?
ao started doing it for styles and I trust him
i guess i might as well just try with 0 and other setting since they train that fast
only way to know really lol
yo guys can try the anything v4.5 version for training ?
i train with the model we cant mention since everything has that merged
It's all a lie, you can get the same details with dim16 and dim128 if you just raise the weight when using the lora
dunno if anything v4.5 is better
left is 128, right is resized to 16
Same
Bad idea imo, it'll bake in the shading and make it look flatter in the end
The link that was already there is the one we can't mention
Works best
I just can't mention it

btw does it say its using dreambooth method now even if it isnt?
thats kinda bugging me a bit
since db method fucks with style lora's apparently
o well run in to issue 💀
expected for first time :x
like are u putting here the name of the project or the data set path
there you put the name of the outer folder
The inner folder has the number at the start
And you put the outer folder in the datasets folder
It sounds confusing but just look at the graph again
oh i think i skipped the project_name folder which i gotta put the 10_xx folder in it
sucks to cant read :lulw:
I could write a small python script so people don't have to go through folder hell
But it is tradition at this point
you could just set a base folder and only make people add the repeats folder
but i guess people just need to understand folder structure anyway
ok we ran it to other error code
The project name is just the name, nothing else
erase the projectname, it should just be Ushio_V1
u mean the datasets folder or
In the 🔴setup
oh ok
When it fails you just need to run C and D again
I was just going to ask with the new locon technique https://github.com/KohakuBlueleaf/LyCORIS/tree/locon-archive but it seems that they already integrated it
L
L
L is Real
What's the difference ?
LoCon needs https://github.com/KohakuBlueleaf/Lycoris I believe
while Kohya LoCon is built in from what i recall?
Someone please correct me
I made a new version of my Colab. As it is a breaking change it will stay separate from the old one. Find it here:
https://colab.research.google.com/drive/1fs7oHytA4Va0IzDK-F8q_q9RIJRIh5Dv?usp=sharing
-Updated to the latest kohya version
-One click to install and run everything (will pick up from where it left if interrupted)
-More options but also more instructions
-No messing with folder names, choose your repeats directly from the colab
-Helpful messages for common errors
In the future I might add locon support

Also saves the configs you used in a folder

Added LoCon and LoHa support
Havent tried any of those before heard they can get better results at lower dims but dunno what params they use
For the "official" example of loha: linear dim 8, conv dim 4, alpha 1, constant ADAMW, 2e-4 for both tte and unet
Compared against locon with linear dim 16 and conv dim 8 (the rest are the same)
Both are of size around 30MB, 5 characters + multiple styles trained in with the capacity of combining them.
This is actually documented in my civitai model page https://civitai.com/models/17336/roukin8-character-lohaloconfullckpt-8
The problem is that I have not tested on other types of tasks and a few changes have happened since then so you may still need to play a bit around learn rates for the specific tasks. Would be great if you could get back to us or just share the results on civitai with parameters documented if you are able to make a good one.
Thank you very much but WHY clip skip 1
Why not?
Because clip skip 2 is standard for every anime model and lora
Do yo mean ADAMW8bit?
Clip skip 2 copies pastes the training images more easily in the experiments
I did not use 8bit. There is not so big difference for lora-type training.
But I think everything depends on the configuration. With both clip skip 1 and 2 you can get good results. Cilp skip 2 supposedly trains slower by the way.
One of my users made this locon with my default parameters
I say "my users" because it's some guy who speaks spanish in a small group we have
I have a spanish version of the trainer :b
Honestly I still don't understand the benefit of having tte learning rate smaller than unet learning rate, but I guess this is beneficial in some task.
Do you know if having text encoder learning rate at 0 is the same as having no text files?
No it is not. It just fixes the tte during training but the information is still forwarded to unet.
I am actually more for pivotal tuning then training tte, but need to see when this gets implemented in kohya.
Thank you - and related question, kohya lets me set "only train unet" - is this the same as TE learning rate at 0?
These might be annoying questions but I'm trying to optimize my trainer
I think so.
Thank you. I can dig into the code if I wanna be sure
I don't even know if loras can do this by themselves
but nice locon
[model_arguments]
pretrained_model_name_or_path = "/content/model.safetensors"
[additional_network_arguments]
unet_lr = 0.0005
text_encoder_lr = 5e-5
network_module = "lycoris.kohya"
network_dim = 16
network_alpha = 8
network_args = [ "conv_dim=8", "conv_alpha=1", "algo=lora",]
network_train_unet_only = false
[optimizer_arguments]
optimizer_type = "AdamW8bit"
learning_rate = 0.0005
lr_scheduler = "cosine_with_restarts"
lr_warmup_steps = 50
lr_scheduler_num_cycles = 3
[dataset_arguments]
cache_latents = true
debug_dataset = false
[training_arguments]
output_dir = "/content/drive/MyDrive/lora_training/output/toyfaces_lc"
output_name = "toyfaces_lc"
save_precision = "fp16"
save_every_n_epochs = 1
train_batch_size = 2
max_token_length = 225
mem_eff_attn = false
xformers = true
max_train_epochs = 10
max_data_loader_n_workers = 8
persistent_data_loader_workers = true
seed = 42
mixed_precision = "fp16"
clip_skip = 2
logging_dir = "/content/drive/MyDrive/lora_training/log"
log_prefix = "toyfaces_lc"
lowram = true
[dreambooth_arguments]
prior_loss_weight = 1.0
[saving_arguments]
save_model_as = "safetensors"
@deep geyser is the default model in your trainer animefull-final?
yes
@deep geyser i reckon you cant do multiple folders in the new version?
the feature was useful for multiple concepts
you can't, new version of kohya changed how it works, currently on my colab you would need to edit the code to add another dataset
zamn
i just noticed on your page it says you trained for 6000 steps but that would be 18000 steps on epoch 30 did you use batch size 3 and this is like an absurd ammount of steps or am i being dumb somewhere?
yes batch size 3
The locon version I added today was done by much earlier
the eyes on the v1 are fucked but otherwise looks good
but i guess having that many images does help
The locon was epoch 16 I think
oh yeah i kinda wanna try to do an style on the new collab any settings i need to be wary for the locon?
Default settings is about right
Here's what I used
But again it was 600 images on batch size 3 so
ill give it a look ty very much
My colab is cool now and spits out the config file if you wanna share it
And possibly load it back into the colab in the future
oh thats really neat
I made a colab to gather a dataset for Lora training
-Choose desired booru tags and download hundreds of images in seconds
-Run the WD Tagger AI to quickly assign tags to those images
Useful if you're lazy like me
https://colab.research.google.com/drive/1-D58Nx782_aj_BYtJS0uPU79WAhS1ldL?usp=sharing
yay
@deep geyser wont you happen to know some default seetings for baking a pose/concept lora? i heard somewhere of using 5e-5 for unet lr and lr but idk if it will work on 32/16
depends on the number of images, probably 2e-4 for dim32
the rest of the settings well I recommend what's default on my trainer because that's worked for me
oh yeah i meant 5e-4 mb
i think that was the default for 128/128
im kinda lost with the new defaults
also would that still apply if i try to train a loha on your new collab?
i love technology
lol
i trained a locon with uhh lemme check
# num_images = 664
# num_repeats = 1
# resolution = 512
# keep_tokens = 0
# shuffle_caption = True
# flip_aug = True
[additional_network_arguments]
unet_lr = 0.0001
text_encoder_lr = 1e-5
network_dim = 16
network_alpha = 8
network_module = "lycoris.kohya"
network_args = [ "conv_dim=8", "conv_alpha=1", "algo=lora",]
[optimizer_arguments]
learning_rate = 0.0001
lr_scheduler = "cosine_with_restarts"
lr_scheduler_num_cycles = 3
lr_warmup_steps = 300
optimizer_type = "AdamW8bit"
[training_arguments]
max_train_epochs = 30
save_every_n_epochs = 1
train_batch_size = 3```
yea
Nothing goes in the tag, any keyword? style etc?
I don't understand the question
For this locon as it is a style there's no activation tag, it just works
if i want to train a single lora with finetune on multiple related concepts/trigger words (like tamamo no mae wearing default costume + casual + swimsuit) how should i structure my dataset folder
im not even sure how to do that with the dreambooth colab, could it even be done in the newest versions?
should i just dump all the 3 datasets in the same folder and only distinguish them by tagging them correctly by concept?
hollow, i need help
I removed the vae from the anime model, I might've done it wrong, for now use model_with_vae.safetensors
Ah, I don't really understand. I will try again later. Thanks for the answer.
change the link for the model for this one https://huggingface.co/LarryAIDraw/animefull-final-pruned/resolve/main/animefull-final-pruned.ckpt
dunno why it happens but this one worked for me
btw hollow first concept locon trained and the results are amazing


Hi all, kinda noob question. Could someone recommend some models to train LoRAs on? I'd like to train a mangaka's style but not sure which model I should use
Usually its ||novelai|| for anime models and stable diffusion for realistic models.
thanks a lot, I just found Hollowstrawberry's colab and the guide linked there also provides good pointers so that's what I'll do.
anyone have thoughts on specific details of a character? like should I add cropped images to the dataset of that specific detail (specifically katarina's belly tattoo)
One or two can't hurt, just make sure to tag it correctly
For more detailed lora's I've seen people say 768 resolution is better, for example to get nahida's cross shaped pupils was a nightmare for everyone until someone trained at 768 and only tagger her pupils when you could make them out by the thumbnail alone
I added like half tattoo shots and half normal pics and removed tattoo tags and it seemed to work well and consistently gave her tattoos so need to do more testing with her eye scar and then to see if removing the tags was the reason why or what be
haven't checked. Is this updated for LyCORIS?
which, coincidentally, sounds a lot like Lykon
After curating dataset images, ran 4️⃣ Tag your images cell, this error occured
oops <= instead of <
will try
off by one errors, my favorite

I also saw you're trying to make fancaps scrapper
maybe there's something you can take from here: https://github.com/Fannovel16/fancaps-scraper
works btw
also oops i was working on the live version earlier
lolol
nice, fixed on the original too
thamks
Also, can I request a few feature here.. Idk if this will help in training tho
Character tags in wd tagger
and a way to get tags from gelbooru then merge it with tags from wd tagger (you have remove tag duplicates already ig)
hi
I can add that yes
The reason we don't just grab the tags from the website is there's a bunch of tags we don't care about like artists and franchises and rating and stuff
But it's easy for me to save them if you need them
It's harder to mix them with the other ones though
Cause wd tagger just replaces the whole file
I see
https://huggingface.co/hollowstrawberry/animemodel/resolve/main/model.safetensors
is this nai + nai vae or wd vae? 🤔
nvm it's wd vae 
it's the original animefull-final-pruned but fp16 and safetensors
it came with its vae baked in
You sure?
The outputs from that model really vibrant, but after I used nai vae from my repo it's less vibrant
@deep geyser
can I request one more feature? 
fiftyone for removing duplicates,
since even after deselecting include_posts_with_parent dup still exists sometimes, and I have 400+ images so manual curating is a bit painful
hollowstrawberry's model.safetensors test
Left, VAE: None
Right, VAE: Nai Vae
emptycanvas = nai w/ nai vae baked
Surprising findings, let me test
But I can assure you it's not wd vae
Yes I would love to add this, thanks for the reference
I have added this feature
duplicates are marked for deletion and you can mark more if you want
much better than sifting through google drive
thank you
at the fourth step it just does this for me
well i just fixed it somehow by instead of running the steps in order i just restarted the run time and ran step 1 and then 4
it's perfect LoCon xd
thank you, hopefully I fixed it now
I am struggling to make it work on jupyter for several days now, does anyone have a hint on what I should do please ?
I am not used to jupyter and colab, is there a guide somewhere ? I just want to run the training locally instead of on google's servers
it is possible, but you have to use a venv or conda at least for it. There are a lot of guides how to setup local runtime for Colab
Colaboratory, or Colab, is a hosted Jupyter notebook service requiring zero setup and providing free access to compute resources. It is a convenient and powerful way to share research, and we use it extensively in The Lab. What’s The Lab? The Lab is the RW Pro group’s portal for doing collaborative research together as a ... Read more
Thank you I will try

ye of course
it seems theres some issue after xformers updated yesterday
all my loras come out fried from epoch 1
aww bummer wanted to bake an style lora before going to bed
input ":question: Enter the word 'yes' if you want to proceed with the download: " didn't shows up
@deep geyser
I used this as temporary fix 
oh that happened to me once, idk whats up
i just ran the cell again and it worked
also nice color scheme
I used dark theme + this colorization 
how do i get colorizations
tools > settings > site > change theme to dark > editor tab > colorization
then double click a cell to refresh the theme
oh i had to switch from adaptive to dark
yep
also why no aria2c in here 
I saw it was installed
aria2c works with single files? whack
eh needs some tweaking so I won't do it right away
That was civitai crashing, it's usually like 100 MB/s
aria2c is still at least twice as fast
Hello what are your configs
done
did you happen to select locon/loha?
I haven't seen this issue before
Please try again as some stuff broke yesterday
lora
i think its fixed
i didnt change anything
except resolution
from 768 to default
WARNING The following values were not passed to
any idea on how to fix for lora training
We'll need more context
i tried to run the kohya easy script filled out everything and it would load the folder when it was in the dataset folder
got that error
help
Found 259 images with 10 repeats, equaling 2590 steps. 📉 Divide 2590 steps by 2 batch size to get 1295.0 steps per epoch. 🔮 There will be 10 epochs, for around 12950 total training steps. 💥 Error: Your total steps are too high. You probably made a mistake. Aborting...
Lower your repeats and epochs
Your repeats are too high, it would've taken like 6 hours to train
And possibly burn it
use 1 or 2 repeat
i use 2 and its working thank you 😄
how do i check the first post?
You can't but you can check the pinned post

it's not a bug, it's a feature
shut it tod
Try to disconnect from the session (top right corner) and reload the page to try again
I used the colab half an hour ago so it should work
Share your training config and dataset if you can and it ends up looking good cause i might want to retrain a multi outfit lora i did long ago with the new tools we have now
Uploaded the dataset and config here
https://civitai.com/models/28686
Also saw your guide on pruning and dunno if its the best way to go cause other people do go for the overboard tagging
What did I say about pruning I forgor
Prune stuff you want to be always there or is common to the character
Which is true if you just want to prompt one outfit hairstyle etc
I think you could probably rephrase it or something in case people wanted more flexibility
I got told I'm doing it wrong by not pruning everything and not having a single tag
My feelings got hurt lmao
I think that way of doing things stayed from embeddings and idk if the ai doesn't benefit from the help of the tags it already understand
There's many things to say about pruning and I'm not sure about any of them at this point
No no its not wrong since the tag you add absorbs basically what your prune and tagger usually does a lot of false positives
But we certainly would need more info and data on the matter
Yeah
In my experiments
90% of the time
Dataset was the defining factor
That and not baking stuff to hell and back
Haven't tried regularization images either which might or might not help
This lora is probably my best one cause it actually balances multiple outfits and gives each an activation tag
even if I had to un-prune a bunch to prevent them from bleeding into each other
It does look very good but you basically did what i told you more or less
There are people that legit prune all outfit tags etc
And just add an inicialization token
And call it off
derrian says they're not working correctly in kohya
idk
There was one dude experimenting with that in one of the multiple lora rentries but idk if he ended up saying anything definitive about it
Did you tell me previously or you mean right now?
Now
gg
What do you think I should say about pruning in the guide?
I want to present flexible options while also guiding people on the right track
I didnt see your other tries if you posted em but if you can reliably get the 4 outfits at 0.7-1 and can gen more than those outfits and its not super overfit i think thats a sucess for multiconcept,multicharacter,multioutfit
At least from what ive seen so far
Like other either that or finetuning a model and thats painful as fuck
yeah it works fine at 1
Only the hair bow is baked in for some reason
Honestly i dont really know cause almost everything you said and have provided already streamlines the process well enough for everyone
And people that just want to train their first lora wont do schizo tagging
This was my first try I think
But you could probably mske the distinction for more flexibility
Actually let me search for a tagging guide i saw a few weeks ago
From an anon that does blue archive lora's
It goes really deep into it
the human form got fucked
the eyes were not accurate
Yeah eyes you can give up
Nahida was the test subject gor getting decent eyes on loras
And getting them required 1mp training
And autism tagging
- only tagging the eyes when you coulf clearly see them by the thumbnail alone
Usually its just better to do an inpaint lora on top

There is also the issue of duplicate tags on multiple outfits
And idk if just the trigger tag can soak the differences alone
So you probably also need to change the dupe tags for one of the outfits which is a pain in the ads
And another thing ive seen people focus on recently is multiple angles with proper tagging
Which helps a lot on getting details right
Which is also more work
At the end of the day if the dataset is good you can just autotag and make a quick lora and the results will be decent enough
So this is probably only for people that want to go the extramile
Additionally idk if its the best way to go about it but ive seen people train on 128/128 and then resize the lora with the resize script thats on kohya repo
I think it retains more details that directly training at lower dim/alpha but it might be biased
ye i did which is how I got these 2 slightly different dresses to work
Still not perfect but who's gonna notice
I've resized several from 128 to 16 and it works nicely
It's impossible to know if training at 16 directly would've been better for those as they're old and not mine
ZOOMIN
in any case, use lora locon, it works for style art, but try using it to make characters, and it works well I think
I found locon easy enough for styles for characters i couldn't get the same ammount of detail
Also found more fucked up hands for some reason dunno why
Locon isn't good for characters
For the dataset maker, is this needed if I want to do a style without any activation words?
Same with this setting in the Lora Trainer
nope
You can still tweak the tags but it's not too important
I heard text encoder is important for locon styles btw, so do make sure the tags are well represented
Ok, so I leave the activation tag to "0" in the lora trainer?
yes
Alright, thanks
@deep geyser so how are you doing your dataset for these holo multioutfits lora's? as in number of images per outfit and lr
It should say so in the version description
As for how, you mean with my colabs?
For example for Ina
In the dataset maker I set the project name to ina/priestess, and do everything for that outfit. Then do the same for ina/kimono, etc.
In the lora trainer I set the project name to ina, then scroll down to the custom dataset box and write the folders I'm using and their repeats
As to the number of images, ideally you want at least 20 per outfit, but less still works.
What's important is the images×repetitions. You need to balance those if you want the outfits to work equally well. For example, imagine you have 3 folders:
Folder A with 100 images
Folder B with 50 images
Folder C with 20 images
You'd set 1 repeat for A, 2 repeats for B, and 5 repeats for C, then all of them have 100 images×repeats for a total of 300.
A healthy amount of images×repeats is either 400 in total or around 200 per outfit, whichever you can get.
It's not always so simple but yeah
i just have my nene dataset from super long ago laying around and it was honestly such a messy job so i was wondering if maybe doing it in your collab with more careful tagging would do the work but like idk the learning rates i should use in this case given the huge ammount of images
nene huh? I forgot nene existed
Is there a lora on civitai? There's one in a mega link at least
2000 steps with min_snr_gamma and 5e-4 unet works really well for me
3000 if I'm feeling fancy
min_snr_gamma is that a new thing?
oh smoother training that seems nice
did you use flip aug
?
Make TRIPLE SURE that you won't regret using flip aug...
Any detail that goes to the left or right will start going to either side, and sometimes to both sides (though this also happens without it)
I went from having it off by default, to on by default, to off by default
You can also flip aug specific folders only
i would care for this except for the fact that the outfits that have less images are the ones that have either the hairclip or the flower ornament on one side
and honestly i dont think its worth the loss of quality overall
over those being on the wrong side of the hair
ye whenever loss goes back up from a training step it tries to diminish it
min_snr_gamma halves the amount of epochs I need to train for
did you notice if using ina_x
made outfits bleed into ina?
cause when i did mine for nene i used outfitx
and i suppose it was overbaking but a bit bleed onto the others
but i didnt do as much careful tagging
in theory it should be a different token for each
but idk anymore
i didn't get outfit bleed with ina, but I did with ollie. Took 3 tries, I had to un-prune tags
yeah...
That's when I turned off flip aug
Worse
Her FACE is asymmetrical
I didn't think about it either
I'm an idiot
Instead of a face like (\) I got (X), and both eyes the same color


@deep geyser Thanks for sharing lot of information!
What repo do you use? With Kohya I don't have min_snr_gamma.
For unet 5e-4 but which value do you use for Text encoder?
And as LR is related to batch size, which do you use?
I use my colab which is pinned here and #1093035978320523264
For local training I use #1073837013758902355
I use text encoder 1e-4 and batch size 2
Thanks a lot. I'll make more test.
For now I can't reproduce my results in a quick way.
The settings I used take 12 hours to get a correct lora 😢
I use exactly the settings you recommend and it was very bad for me.
Sorry to hear. What are you training?
a style on a small dataset
ah yes that'll probably need different settings
I'm most knowledgeable on character loras
ok.
how small of a dataset are we talking about?
24 images.
Yeah thats really small of a dataset for artstyles
Ideally you have 100-200
What you can do is make closeup shots of faces for example if its an anime style
With proper tagging of closeups to artificially create 2x images
Then you could use flip_aug and play with the learning rates
Cause it will probably overbake before you get what you want
Also make sure for artstyles you need to train for longer characters usually are done between 1-2k steps with normal settings, styles is not a certain science and depends a lot on your dataset like everything honestly but it should bake for longer
Or until you basically can notice it with it losing flexibility
When I was researching for my style lora (example attached) I saw that usually training between 4k-6k steps will get a style down pretty well. I trained on 48 images. My understanding is that quality of data is better than quantity of data (once you get above a minimum dataset size) so as long as your tags are good, you should be able to get a nice and flexible lora
@deep geyser did you use easy_scripts to resize your loras?
yes
i saw he added new stuff to the bat file if you dont mind sharing the settings you used i would appreciate it
Well I use it to resize other people's loras
There should be a text file with the recommended settings
these ones?

i reckon you used dinamic
thats what i heard
kinda curious to actually finish tagging my nene lora again
and see if resize doesnt butcher the details
my last try got outfits right but because i pruned the hairstyles like an idiot they got all mangeld up
nene has a million variants for each outfit which doesnt help at all
and not that decent art

like the china girl outfit and the main one are okay
even the blazer one
but the new years, swimsuit and a few random ones here and there are wew
Yeah I learned that in my 3 tries for Ollie
Mind if I try?
Are you tagging manually?
yeah
but the dataset is really big
so sometimes i miss some stuff
im gonna go to sleep in a bit
ill hit u up tomorrow
this is the old one i did when pruning everything and added an activation tag was a thing, its also gigabaked so i used it at like 0.7 and had to use outfit0,outfit1,outfit2,outfit3,outfit4 + some common tags and there was a lot of stuff appearing on the others if i went above 0.7

it was also done when we barely knew anything about loras
i reckon with your collab and the new tools it will go easier
actually let me just link you the mega link that also had the dataset
so you can see what a mess it was
it was basically all pruned lol
like 1 tag cant hold everything
I didn't realize nene was missing from civitai and she's my wife so now I want to try
But I don't want to step on your toes if this is important to you
no no
go for it
feel free to reuse this old dataset
if you want
I have the means cause I did 9 outfits for rushia, the idol outfit had only 5 images and I went to get screenshots and it came out nice
That's a nice mindset, thanks
Will look into it
Will probably do it the real way and sort all images into folders one at a time
for rushia i just sorted by booru tags but it's more inaccurate than one would hope
i dont care for the likes, etc on civitai
specially since we didnt really do any images ourselves
and got them without artists permission
but i like ai image generation and want to learn
so its the best mentality to have
True, that's why I have the «do whatever the fuck you want to» license
if people wanna sell im like
ok
you can find it for free so go ahead
i find it a bit scummy to sell but people that do ai stuff on pixiv set up their accounts with fanbox
like at frame 0
so its whatever
at the end of the day i still want to learn to draw on my own
but not learning this stuff for the foreseeable future would be shooting myself in the foot lol
hmmm
the example txt file is not working
thats weird

mine are ordered btw its just the old dataset cause i havent uploaded the new one yet
so at least you wont have to order the og outfit, default, blazer, swimsuit and new years one
just remove the txt files
and tagging hell
also i felt like there were like mayhaps
like a gigazillion pics
but if i don't slave myself like a pig what's the fun of making a lora?
for default outfit, og outfit and random pics
and then blazer, new years outfit and swimsuit took a hit
anyway thanks will take a look
because of repeats
i saw you try to keep em on the hundreds
which might be the right call
new years didnt get that shit
even if it had low images
but swimsuit took a hit and i think its cause there were random pics
with swimsuit tagged as well
that and well
the prunning of all fucking tags
lol
the ai had to do extra work that day

see i have 18 images of new years it's fine
but 11 images of the fucking bikini
it's barely an outfit I can't find a single source for it
I have more images of the unofficial bikini
yeah....
I'm dropping the bikini it's not happening
Yes, I know dataset must be bigger but... it can't be 🙂
I got some good results with this dataset but the training takes between 5 and 12 hours.
So I'm pretty sure I can optimize those settings.
Batch 8, 10 repeats, 100 epochs, (3000 steps), constant, lr 5e-5, text 2e-5, 128/64 dim/alpha.
🧎♂️🧎♂️
Only thing i can notice at a glance is the skirts took a hit
Otherwise it looks really good
Lets see if ill be able to do any better
Only god know what you have to be doing to get those times qith your small dataset
For starters dont do batch size 8
Do 1-2
My research told me to have repeats and epochs equal, also your dim/alpha is pretty large, I'd go smaller
thanks.
Maybe try something like 22 repeats, 22 epochs, batch size 2. For 24 images that should get you to 5,808 steps. You can probably get something passable with the tiny dataset as long as the tags are near perfect
Thanks a lot, I'll try that.
Good luck!!
thanks
what model do yall train loras on? I want to train a lora for AOM3A3 but since the style is 3dish theres not many images online for that kinda training. So if I train with anythingv3 and then just use that lora with AOM3A3 will it work?
aom3a3 was mixed with nai so train on nai
nai is almost always the best
Train in nai
Test in nai
I test in the model I actually wanna use
nai as in novel ai?
anything v3 is basically nai but better right
I see
where can i get this
fp16 fine to train with?
seems trash for generation tho lol
unless my prompts are trash
it's still not perfectly close but closer than before.
nice job
when i'm tryna use the lora colab it makes a duplicate dataset folder instead of recognising my dataset folder

dataset <> datasets also everything is case sensitive
i did dataset
it's not detecting because of the text files containing the prompt
do i place them separately in a folder?
Is it a duplicate folder with the same name? This is a rare bug with Google Drive...
Try moving the images to the new folder and deleting the old one
Alternatively, rename both folders, wait 5 minutes, rename your dataset folder again, and wait 5 more minutes, then restart the colab
Yep that's it
I'll try tomorrow and update you

I did the moving images thing too, it created yet another folder
ok
Hello, I want to install Kohya to train custom loras. I found a couple of youtube tutorials that are 2months old and apparently outdated. What is the most recent, beginner friendly guide I can follow?
it hasn't moved in 50 minutes
xd
So I shouldn't wait?
I can give you a link to this dataset, if you want to find bug or something
what were you trying to train?
arts by tag vocaloid in danbooru
(Locon Lycoris)
whats the best amount of dataset for a usual style lora?
100 images is the sweet spot
If you can get 200, cool
If you can get 50, fine
so 100 is like the amount that doesnt fry it
Within some assumptions, the answer to that question is yes
i am a lazy potato so whats the best settings for 62
dataset
images
or whatever


With 62 images, do 5 repetitions and 10 epochs, 2 batch size, 5e-4 unet, 1e-4 text encoder, min_snr_gamma at 5, cosine with 3 restarts, 150 warmup steps
That's how I'd do it but there are many methods and none of them is perfect
thank you i will now forever save that in my notepad
You could also do 2 repetitions to match the 2 batch size and just have more epochs like 20
But that's usually what you'd do with 100 or 200 images
so 2 rep 2 batch for 20 epochs
so what if its 30
is it going to be 1 rep and 1 batch
30 images is not quite enough to stabilize it, but it'll still be usable
I always do 2 batch size though
So maybe 4 repeats with 30 images
wait i mean 30 epochs-
And enough epochs to reach 1500 to 3000 steps
Dont die in a hole thats bad for your health
Anyway 30 epochs would be 1 repeat yeah
But like I said I always do 2 batch size
but if i die i wont need to worry for my health
I tried a 7 image lora and it seemed to do better with 2 batch size than 1 batch size
I tried a 1000 image lora and it seemed to do better with 2 batch size than 3 batch size

well if you don't give a fuck and do popular characters it's easy
but if you do multiple outfits like me then yeah you do reach those numbers too
im a style lora person
I'm a character lora person
Also supposedly locons are better for styles so probably do that
are locons smaller
Or be me an do whatever and pay the consequences later XD
they're, bigger, but you make them smaller, so they're the same size
im sticking with loras
i dont want to learn an entire math equation again
i took 2 months to learn how loras work
i dont need another 2 months of my life gone
Oo; same math
Nah locons are just
if you use holo's notebooks just same math XD
A locon is just a lora but you have a second layer of neurons
Normally you'd have a lora with dim32 alpha16
For locon you halve it, then halve it again for the conv layer, so dim16 alpha8 conv_dim8 conv_alpha4

It's that extra layer that learns styles better
I forgot to say dim32 alpha16 is epic
mb
what colab are you using
mine, pinned here
There's no samples in my colab
If you can get 6059?
fsfsfsfsfsfsff
Trim it down to 400 and do 1 repeat
Pick the best ones, no way you have 6000 good images
I just initially wanted to tune natively, but then I realized how long and inefficient it is
is the trainer only made for character training?
because when i trained my style lora it didnt apply any style
the default values are what I use for characters but it's not "made" for it
You might've had a learning rate too low. Also, did you try locon?
ah nope
though whats good for locon 62 dataset?
HELP
the defaults should be fine - don't go over 5 repeats though
ok thanks
but what do you mean by "over 5 repeats?" also can you add auto tagger?
there's a tagger in the dataset maker
oh but can you do the same in the regular colab
no
.
They both use the same drive folder just go to the other colab
is the dataset maker able to gather artstyles
from gelbooru? you can use an artist tag yes
ok thanks
what did you mean by 150 warmup steps here
5%
is it for other colabs?
my colab has warmup ratio
oh
can you add emojis to the name of the lora for no reason
ok so default settings is fine for 62 dataset?
locon
?
Yes this is what I told you last time and that's the default except for the repeats
If you tried it and it didn't work then oof
locon for styles is better though
On the last part the defaults should work
dim16 alpha8 conv_dim8 conv_alpha4
or conv_alpha1 idk
you were correct i successfully trained the locon a bit nsfw though
Maybe it s dataset issue sir
Helloo
I would like to ask senpais for some tagging advice 
I was training Lora for Kaguya Otsutsuki, but considering she's wearing a white robe that makes her look flat on most of the dataset images it's hard to derive from small breasts and no robe when rendering txt2img.
Soo, if it's recommended to remove characteristics tags to stabilize the character's traits should I tag her with "small breasts, white robe" to achieve the opposite - no robe and bigger breasts?
That sounds about right
There's also flat chest
Will try, thank you
also did someone maybe put together a document of efficient training settings for different dataset sizes? I've been looking them up in channel histories so far 😆
Most of what's been researched in general resumes to "it worked for me" so idk what to tell you
Usually having a good dataset and decent ammount of images in it does most of the work
Pretty much yeah
I'm sticking by my 400 images×repeats, 5e-4 unet, dim16, batch size 2 setup
I just trained a Locon with 66 images × 5 repeats plus 35 images × 2 repeats
Thanks to some tweaking that comes out to exactly 400
And it worked perfectly 
appreciate it, thanks for the info!
@deep geyser could you add an auto background adder for zip datasets on the trainer?
Thank you for the suggestion but I believe it would be useless as transparent backgrounds are treated as black by the AI
Id like to tag my dataset in a way where it focuses only on the face. What ive tested is that the clothes and other characteristic seem to leak during genearion. Would like to ask some tagging tips. Thanks for your attention :)
will there be a feature to train lokr's?
Ok? I wanna use WD 1.4 tags on this dataset
Also does the normal settings for the learning rate and scheduler work well for my objective?
I'm not really sure, but it probably is
I'll look into it if there's demand for it
its smaller and seems a bit better
https://civitai.com/models/35136/mika-pikazo-lokr
this one is 2mb
Okay man. Btw can i DM you sometime? I have some further questions
Sure, just leave me a question and I'll try to answer
yeah
Sounds like demand to me
I'll dedicate a couple hours to it when I feel less tired
Just need to update kohya to the latest release if applicable, test it, look up the parameters for lokr, account for those, test it, profit
See https://civitai.com/models/48738/megumin-ed-style-lokr for another example of how Lokr is overpowered
First time making a LoKr very limited dataset. (notice: Civitai changes the name of the lokr/lora if u copy prompt from the images it won't be exac...
What type of Lora is better to use for some phenomenon/action?
#1094438173892943892
Recently compared my newer Loras with old stuff I made with the previous version of the lora trainer and saw that old Loras were better. Probably using a bad setting but does anyone know what the default setting for old training was?
Dunno but my newer ones using holo's are better than my old ones XD
Mean as said I'm probably using wrong settings so trying to figure out what I'm doing wrong 
My trainer spits out the config file so you can check
As long as you didn't delete the old folders
You're using the wrong model, possibly stable diffusion 2.0
Old one didn't at least for me
The trainer isn't working for me anymore, gives ERROR: No matching distribution found for torch==2.0.0+cu118

Try now
yup its fixed, awesome, appreciate it. Was the change super easy? I'd love to know how to fix it if it happens again
when google updates colab itself the versions change
this time I could've tried to adapt to their new versions but I just forced it to load it from the old place
ah okay
I wonder how a 8dim resize of my mika pikazo lora would compare
at the moment it's 64dim
in theory lokr is just a different method for parametrization
I wonder if a normal lora training + resize approximation is a viable alternative
Dynamic resizing is pretty effective
I don't know how it works though
~_~ i shave your loras down a bit so i can use them for stuff COUGHS i should literally give you the 32dim ones for your stuff - AND any mooshed versions i've made XD if it's Vox/Western and it's entirely just your stuff i keep A LOT OF my lora squishes XD (I haven't tested vox+western outside of applying it to a model for that specific reason lol)
I might post 32dim version, slowly
trying to load safetensor into the colab
probably the wrong link and it loaded a website instead
it's saying the file is invalid
Remember it has to be a direct download
i see
drive or mega wont work
i try linking it directly to the safetensor on my huggingface repo
if i dont it just gives me another error cuz it trys to save model as ckpt
yea i use the url to the huggingface repo, it just doesnt work
ah
I thought I was handling those
you need this link instead
https://huggingface.co/ModernNoob/Deyui_Model/resolve/main/Deyui_Diffusion_Model-04.safetensors
(right click the download button -> copy link)
notice it says "resolve" instead of "blob"
again, I thought I was replacing that automatically, guess not
Oh i see
bro im blind as a fking bat
i should prob make a pr and just change blob to resolve for u :v
same error
ill check
aight
also, not sure if thats telling something
imma train on the default model on another dataset in the meantime.
it works generally
the key error means the model is invalid somehow
it's looking for something but it's not there
can u send me an url that does work? I want to try to find a difference or something
hello! i have dataset composed of images that is not 512x512. any tips? or guides for training lora with these images
i dont want to crop them too
@gentle kettle the training resolution doesn't matter, you can use any image sizes
ohhh what resolution will I use during training for the LoRa?
@deep geyser does your dadaptation implementation in the collab support "betas=0.9,0.99" as a param or is it not needed?
I think that's set as the default but not sure
think the default only had decouple true and weight decay
Hey, i get this pip error that says “pip’s dependency resolver does not take into ac… blah blah and 4 lines of respectively torchaudio, torchdata, torchtext and torchvision being incompatible(?)”
I am currently training even after this error (hopefully its actually training even after this error)
I can send the actual text if im asked.
Sorry I couldn’t search the thread
Hey, no worries, this is normal
The only downside is it takes longer to load
One day I'll fix that warning ...
Yeah it's spooky
I had notifications turned on it seems 
Actually, while at it, I would like to ask a few things to avoid multiple notifications. Of course, these are a lot of questions and will probably waste your time so please answer whenever you like or if you like to at all. Thanks for the notebook, too.
1 - If interrupted, can i just go start the same main cell and continue from where I left off without really changing anything?
2 - If I wanted to train with a lot more images, would lora no longer be a good choice? Lets say, 3-4k or more images.
3 - Since I downloaded the AnyLoRa, is it best if I use this lora by first loading AnyLoRa itself into webui or can I load any other model just fine?
4 - Is setting resolution to maximum possible good idea (dataset may have less than that resolution images) or will it exponentially slow down?
5 - Why is there a max total step limit? Funny but I literally reached there and changed how_many as a result. Is it an overcooking issue?
6 - When is more dim holding more information worse? Another overcooking or big file size lora that doesnt do any better issue?
Thanks in advance no matter how many you want to answer.
Wow thats a text wall, really really sorry
-
Training will start from scratch but it will skip the 3-4 minutes of installation.
-
For that you could look into LoHa but most likely you want a checkpoint. Otherwise 400 images is my personal limit. At some point it can't learn any more, so quality over quantity.
-
Loras work with any checkpoint, personally I like training on animefull then testing on anylora.
-
Multiplying the training resolution by 2 will multiply the training time by 4 or more. Stable Diffusion models don't really understand pixels, it's all math to them, so the training resolution is less important than you think. You only need 768, 1024 or more if you need to capture small details like accessories or pupils.
-
It was a common mistake to set one of the values wrong and end up with huge training times, I know the limit has saved me and others a few times. But the limit itself is unnecessary. Maybe you could train a loha for more than 10000 steps, but I try to encourage best practices and I don't think there's a good reason to go over in most cases. Same reason I don't have a VAE option in the trainer (they make things worse, last time we checked)
-
Large dim may introduce small visual artifacts, possibly because it makes stuff up to to fill all the data. Those are rarely perceptible, though. Regardless, dim32 for lora or dim16 for locon should be good for 99% of cases. dim64 may be useful for something. dim128 is the old way of doing things and I would advise against it. I know I've filled 10 different sets of clothes of an anime character into a single dim32 lora.
It's okay
guess loras dont need multiple sessions training
I love helping and answering questions in this subject, I also have a ko-fi which keeps me motivated to do so thanks to generous peeps
There are 2 ways to continue lora training, I implemented them both but they're so bad they're now hidden in the colab code
One way is to store the weights which is several GB, I ruled it out due to the limited available space and the weird latency on google drive
The other is to load the previous safetensors and continue from there, but it seemed to not work
Those were beyond my control, I don't know if it's been improved since then
Can somebody help, I am trying to train a Lora 321 Images, 1 Repeat, 6 Epoches, Total Steps are 1926 , My problem is I only get really messy stuff, However I've been using an Collab for a while and do around 10 Epoches most of the time 5000 Steps and It isn't some overcooked garbage
At around 1200 Steps
Learning Rate 0,00001, Text Encoder LR: 0,0001, UNET LR: 0,00001
DIM 16 Alpha 8
Bad dataset i suppose
That's the weird thing, I've used the same datasets before and zero problems
that unet is too low
But I don't know why it would generate trash like that
What would you recommend ?
What model are you using to train and generate
Something else must be wrong
Send the config file that was generated by the trainer in your Google Drive
There's 2
The Log File or the Settings I've used ?
settings
Trough Google Drive or here ?
send the 2 toml files here
I don't have any toml files
I'm gonna send this regardless
Oh I thought you were using my trainer
Oh
I have been using your trainer however I copied the values from your trainer into mine and I only get garbage
Even at 10 Epoches your trainer does not output anything bad, mine does and I don't know why
style or character¿?
Character
I don't know what "epoch": 6 does
I think you want "max_train_epochs": 6
Also your lr and unet lr should be 1e-4 probably
I don't know, I've never seen "epoch" as just 1 word in the settings file
These are good settings
I would personally do 32/16 and 10 epochs
Entering 0 for Epoch will give me none, so I may just add the same number as Max Epoch?
Also adamw8bit i suppose
Set epoch as none maybe
will only give me 321 Steps
I would recommend this trainer
https://github.com/derrian-distro/LoRA_Easy_Training_Scripts
I haven't checked bmaltais recently so I can't comment on it
Very good trainer
Based holo
Looks nice, gonna give it a try
That's the one your trainer is using ?
Nope
We all use the same base trainer behind the scenes, but this one is by a friend
My theory is that something went wrong with your trainer somehow so it could work to try a different one
try collab meanwhile
Huh I'm gonna give it a try eitherway
Yeah
Which version of Torch should I Install?, 1.12.1, 2.0.0, 2.0.1?
@deep geyser Works like a Charm, Thank You

is there any comparison showing the difference in training LORA from one model to another?
You could see the difference easily but I don't know of anyone showing side to side
animefull or anylora? which one do i use to anime lora?
dont know the difference ._.
animefull is the base model, I recommend it
anylora works too
I train on animefull then test in anylora
ok 
My lora trainer now takes 1 minute to load again instead of 3, cause I fixed the dependency error
Enjoy
1987
This one is good.
Recently I'm using this and I did my sdxl also with this. I'm now liking this trainer more than normal khoya ss gui
@deep geyser does the collab have dadapt v3?
Nope it uses v1.5
does only the kohya trainer have it so far? i kinda wanna try it
welp tried using the new one but i cannot make it see my GPU, it keeps trying to train on my integrated GPU and fail because not enough memory 
back to the old ways ig
2 months late but I did add it as well as prodigy
What's the username/password to the generated gradio link? I didn't see a way to set my own credentials when running this colab
1 month late but ive tried them and honestly saves so much effort ty for your work, wanted to ask as well how to bypass the total step limit you put in place since sometimes some styles will be underbaked or should i just pump up the lr?
You'd have to open the cell's code to remove that check

@deep geyser how long should this take?
found directory /content/drive/MyDrive/lora_training/datasets/Scott-Pilgrim contains 4664 image files
i know its a lot of images but i think it might actually be stuck
huh




