====== Lora Training ======

Training UI

There are quite a few UI out there and online services to help you train, For this guide I'll go into these two (I'll add "how to" for the online ones if someone asks, I don't have much experience with them, though I hear it's fairly easy)

Kohya_ss GUI - Used by most as such easier to share and use other people training parameter

OneTrainer - Very powerful with newer techniques such as masked training/caption variation as well as being the UI of choice for Finetuners

  • OneTrainer also has a wiki explaining all the settings found Here

Procedure

Gathering Dataset

First step in LoRA making is the most cumbersome and longest depending how easily you can get the images for your LoRA. How many pictures you need depends on what type of LoRA you are trying to make, Rule of thumb:

Character = At least 30 pictures

Style = At least 70+ For styles

Generally any type of picture is ok as long as there is variety. For styles (different angles, backgrounds, characters etc.), for characters different angles, outfits, nudes, backgrounds. Try to keep the good portion for your outfit you want to train I use a 50/50 split between the trained outfit and everything else (so for 40 pictures, approx 20 for the outfit, 20 everything else).

//Couple of tools to help you gather dataset//

Hydrus

Grabber

Tagging

I changed to using TAGGUI so I strongly recommend using it for this, it's much easier to use, I can write a guide later but it's very plug and play
TAGGUI

There are quite a few philosophies and UI to tag your pictures but for the sake of simplicity we will do the lazy brainless method, it will make good LoRAs but not perfect LoRAs, you can finetune your procedure after you get you first LoRA going (learn to crawl before you walk and all that jazz XD).

  1. So for this we will use the Webui Tagger extension found here. Install the extension into you webui and restart the webui.

WD-Tagger

  1. The UI should look like the picture below, looks daunting at first but we only need to use the "Additional tags (comma split)" and "Exclude tag, .." to add activation tokens and exclude any unnecessary tokens. Now how you would tag the dataset depends on what type of LoRA you are making,

Alt Tag

  • Style: Nothing really to do, Leave everything blank as you generally don't want a activation token or leave any tags out.
  • Characters/Concept: Generally people add a activation token for them (name of character or action). For characters, drag and drop onto the box and interrogate, this is a good way to see if the tagger is picking up something incorrectly, you can add those to the "Exclude tag, .." portion.
  1. Now with that, the tagging has set up. Now We want to run this on to all the files, to do the that click on "Batch from directory" and in the first box add the filepath to the folder with all your images and click interrogate. It should now go through and add a .txt file to all the images. Tagging done, fairly simple.

Training Kohya_ss GUI

  1. Assuming you have installed the Kohya GUI using the link above, go to the folder and click on "gui.bat" to start the Kohya GUI.
  2. You will be greeted with the following screen, You want to change to the LoRA tab at the top as shown.

Alt Tag

  1. This is where you have two options either find your own settings in the parameters setting (very complicated) or use the settings of someone who has done some successful training and just load theirs. I believe in not re-inventing the wheel so I will provide some json files at the end of the guide, that you can use for your own training. Click on configuration and load the json file with the settings as shown below.

Alt Tag

  1. Set up your folder as shown below, so it should be NAME-->1_NAME, where the "1" in front of the name is telling how many repeats Kohya should be doing, generally keep this to 1 unless you know what you are doing.

Alt Tag

  1. Go back to Kohya GUi and add all the paths as show below. Open Parameters and go straight down to "samples", in that box add your prompt, this is the prompt that will gen after certain intervals just to show you the learning progress. Use the template below if you are confused and just change the character and actions.

Alt Tag

Alt Tag

Alt Tag

Remove score tags if not training pony.

score_9, score_8_up, score_7_up, score_6_up, girl standing, large breasts, bikini, waving, looking at viewer, smile simple background, aua, hololive, twintails, heterochromia, --w 832 --h 1216 --l 7 --d 1005 --n " 3d, monochrome, nsfw, explicit, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, collar, ribbon, toe ring"

  1. Now start training and then sit back and the LoRA should output a LoRA in wherever you set the output folder at specific intervals. Few things to look at during training:

Make sure the loss doesn't say NaN, this means something went wrong and the LoRA is learning nothing
Watch GPU temp, especially if you are training for long periods

Training OneTrainer

I have to rewrite this one but it covers enough basic to get started, let me know if you want to use OneTrainer, I can make it more extensive

  1. I had a bit of a hard time installing this, so if you are getting some trouble getting it going post in the thread. If there are enough people I may add a troubleshooting portion for this. For now I am assuming you have it installed. Click on "start-ui.bat" to start the UI.
  2. It will open up into the following screen, for a simple training the only tabs we care about are "model", "concepts", "training", "sampling", and "backup".

Alt Tag

  1. First set the header dropdown as shown in the image and go to model tab and pick your "Base Model" and your "Model Output Destination" This is where the safetensors will be saved.

Alt Tag

  1. On the concept tab, this is where you will add the location of the folder with your images. Click add concept and it should add a little rainbow box, double click the box and it will open the following window. Add the name (Whatever you want doesn't affect training), the path of the images+text files, leave the other ones as is. I'll make another advanced guide to get into those portions later. Lastly click text augmentation and set keep token as 1 if you have a activation token, or 0 if you don't.

Alt Tag

  1. The meat of everything, is the training tab. This is where you will set up all your training parameters. This far too complex for this guide (and me lol), so I will provide some settings at the end of the guide that other anons have used to get you started. (WIP, One for now, I will add more as I discover them).
  2. Sampling tab, simplest of them all, set when you want the training to spit out a sample of the current state of training. You usually want to use settings as below (I think steps is better that time or epoch but up to you honestly). If you want a sample before the time, just click sample now. Note you can also adjust these as it's training if you want to see a different output so not set in stone.

Alt Tag

  1. Lastly Backup, You don't need backups for simple LoRAs so you can set that to "NEVER", what's important is "Save After" change that to steps/epochs (or time based if you want) and set when you want it to give you a LoRA. I generally use every 100 steps.

Alt Tag

  1. After all this just click Start Training and let it go. NOTE: Anything you change in the UI after training start will reflect on the training in realtime so my advice is just stay on the sampling tab as any changes here won't mess up your output. Few things to look out for as it is training:

    Make sure the loss doesn't say NaN, this means something went wrong and the LoRA is learning nothing.
    Watch GPU temp, especially if you are training for long periods.

Training On Google Colab

==== For SD 1.5 ====

This is the easiest to use colab for 1.5 *Credit goes to HoloStrawberry on Civit.
https://colab.research.google.com/github/hollowstrawberry/kohya-colab/blob/main/Lora_Trainer.ipynb

  1. First go to your google drive and create a folder called "Loras", this where all the datasets will go.
  2. Take your tagged file and create a folder in the Loras folder with the name as seen below. The pictures and text go in the dataset folder and the LoRA will ve outputted in the output (Don't have to make that, the colab will do it at the end)

Alt Tag

  1. Now go back to colab, and input the project name (Same as the name of the folder in the Loras folder we made last step, so Aria_konkon in my case). For settings use what is shown below but you can change if you find some better setting from someone else. This is just what I use for characters.

Alt Tag

Alt Tag

Alt Tag

4.Next go to the "Extras" at the very bottom to set the optimizer and set as below and click on the play button.

Alt Tag

  1. That should set it all up, now go all the way to the top (to "Start Here") and click and play button and it should start the training. With these settings, it should take 20-ish minutes.

==== For SDXL ====

  1. First upload the model you want to train on in your google colab. Anywhere is fine.
  2. Open the the following file in google colab (*Credit goes to the awesome anon who made this)

https://files.catbox.moe/dgk73f.ipynb

  1. In the colab run the the following cells one by one, this will install all the necessary files to do the training. (To run hover over the square brackets and a play button should show up and clicking it will start it.)

Alt Tag

  1. Save all your files in the following format in your google drive "Name-->1_Name" where 1 is the just the number of repeats. You can keep that at 1.

Alt Tag

5.Fill in the paths in the colab as shown. Easy way to do this is to open the side panel as shown (click orange folder icon on the side, should be white before you click it). Find the folder, right click and "copy path".

Alt Tag

  1. Only thing you have to change are the paths and names of the LoRA rest should stay as is. Once done click the play button to start the training. It should take about 1.5 to 2 hours. *For Pony, chances training styles here mostly likely will not work but characters and concepts should be fine.

Kohya Training Settings

Some Example from various anons to get you started. I will separate between what they are used for primarily. There is no real best one here, these all resulted in fairly good LoRAs so can't really go wrong with any. I am including Optimizer used just in case you ever want to learn what's being used and how they work later on, don't worry too much about it starting out.

Characters

=== Prodigy Optimizer ===

https://files.catbox.moe/tvwe4c.json

For GPU with 8GB VRAM

*Use the one above but with the fp8 enabled.

Edit

Pub: 05 May 2025 22:13 UTC

Views: 18