well, I start with 20 pretty decent images, the higher the quality and resolution the better, making sure they are not all from one photo shoot.
Then I use WebUI's "Auto focal point crop" in the extra's tab and "Caption" using both Deepbooru and BLIP while scaling them to 768x768
then I use a program I wrote really quickly in VB.net (Cos I am a lazy programmer and went with what was the quickest, also I hate Python and scripting languages in general, compiled for life bby!) which goes through each caption file, adds the name of the directory to the start of the text file.
Next the program creates a copy of a TOML file I have and replaces the place holders with the relevant data
[-DIR-] = the parent directory
[-NME-] = the name of the person
[-PTM-] = the path to the base model, for example: "G:/webui/models/Stable-diffusion/Base/v1-5-pruned-emaonly.safetensors"
Note:
[MODEL] is just a directory named "[MODEL]", it's so that when I am batch training, I can have all the LoRA's end up in 1 directory so I can easily just select them all and move them to my LoRA directory.
[[subsets]]
num_repeats = 100
keep_tokens = 1
caption_extension = ".txt"
shuffle_caption = true
flip_aug = false
color_aug = false
random_crop = false
is_reg = false
image_dir = "[-DIR-]/[-NME-]/100_[-NME-]"
[noise_args]
[logging_args]
[general_args.args]
pretrained_model_name_or_path = [-PTM-]
mixed_precision = "fp16"
seed = 23
clip_skip = 2
xformers = true
max_train_epochs = 1
max_data_loader_n_workers = 1
persistent_data_loader_workers = true
max_token_length = 225
prior_loss_weight = 1.0
[general_args.dataset_args]
resolution = 767
batch_size = 1
[network_args.args]
network_dim = 32
network_alpha = 16.0
[optimizer_args.args]
optimizer_type = "AdamW"
lr_scheduler = "cosine"
learning_rate = 0.0001
[saving_args.args]
output_dir = "[-DIR-]/[MODEL]"
save_precision = "fp16"
save_model_as = "safetensors"
output_name = "[-NME-]"
[bucket_args.dataset_args]
enable_bucket = true
min_bucket_reso = 256
max_bucket_reso = 1024
bucket_reso_steps = 64
[sample_args.args]
sample_prompts = "[-DIR-]/[-NME-]/smpl.txt"
sample_sampler = "euler_a"
sample_every_n_steps = 500
[optimizer_args.args.optimizer_args]
weight_decay = "0.1"
betas = "0.9,0.99"
And then I use a program called
derrian-distro/LoRA_Easy_Training_Scripts
Hit the "File->Load TOML", then "ADD" then "Start Training"
And then done!