Home Artists Posts Import Register

Content

INDEX:
SD Character LoRA Training Tutorial (Part 02 - Preparation)
SD Character LoRA Training Tutorial (Part 03 - Image Gathering and Tagging)
SD Character LoRA Training Tutorial (Part 04 - Testing)

DISCLAIMER: There are a lot of tutorials on the web and many of them will be probably better than mine. This is just how I train things. I tried other methods, but usually got more problems than solutions.

You should have basic knowledge of AI image generation to understand some things I'm talking on this tutorial. So I advise you to follow a basic tutorial, like:

[Basic Tutorial] Going through basics on Stable Diffusion WebUI

and

[Basic Tutorial] Creating a NSFW fan art AOT Style

Let's get started with my first training tutorial. I will try to not be too much specific in here because there are more specific guides and I think that most of you are still learning the basics.

SUMMARY

1. Introduction
2. Requirements
3. Install Kohya SS
4. Open & Close
5. Update

1. Introduction

What is a LoRA?

Answer: Low Ranking Adaptation.
There is a very big answer for that, but for this tutorial you just need to understand that this is a small model that offers a change to a base model. For example, you could use Stable Diffusion base model and train a LoRA to use together with Stable Diffusion.

2. Requirements

I recommend having a NVIDIA graphics dedicated GPU.
The minimum recommended is a graphics card with 8GB VRAM. You can train with a bit less, but you will face problems and need to reduce more settings to work.
I currently use a RTX 4090, but I will try to guide you on how to reduce the load of your GPU.

3. Install Kohya SS

Here is the repository install section: LINK

I WILL FOLLOW THE WINDOWS INSTALL THERE IS A LINUX AND MACOS SECTION ON THE LINK FOR YOU TO FOLLOW.

Access this link above and go to Installation section.

NOTE: You can follow the link installation guide too, I'm just reproducing it here.

Install Python 3.10 from the link.

Install Git from the link too.

Install the Visual Studio 2015, 2017, 2019, and 2022 redistributable.

Restart the system if necessary.

Create a folder where you want to install Kohya.

NOTE: You can name your folder as you want.

Select the adress bar, type CMD and press enter

This window will pop-up:

It will have the folder adress in there. You can alternatively go that through windows commands, but it's faster this way.

Now copy this text: git clone https://github.com/bmaltais/kohya_ss.git
And paste in there like this:

Press enter and after the short process is done you should type cd kohya_ss and hit enter like this:

It will change the line to this:

Now type or copy paste .\setup.bat and hit enter:

If everything was done correctly you should get this screen after some loading.

Type 1 and enter:

Type 2 and enter:

This will take a while. You will be stuck in this screen for some time, go do some stuff you need and come back. After It's complete it will be like this:

Now you have to select things using your arrow keys or number keys from your keyboard.

NOTE: THE OPTIONS NOW CAN BE SELECTED AGAIN IF YOU DID A MISTAKE, YOU JUST HAVE TO SELECT THE OPTION 4 WHEN STARTING THE SOFTWARE. I WILL SHOW THIS IN THE END OF THIS TUTORIAL PART.

Select the option "This Machine". There will be an asterisk * on the left of your choice.

Select "No distributed training"

Now you should type NO and hit enter.

NO again.

NO one more time.

Now you should answer with: all

Now read the instruction before picking the next option.

READ THIS: Okay, this option is based on your GPU. If you have a 12GB VRAM or more you can pick BF16. If you have a weaker GPU you should definitely pick FP16.

After selecting this, your installation and configuration will be done.

Now select the browser window that you want to pop the window for this, because after you select the next option it will pop-up on your browser.

Select 5

A new CMD window will pop up like this.

You can hit 6 on the old window to close it.

Now on your browser, you probably noticed the window pop-up. It's something like this:

If you got here, then we are fine. I will teach you how to close and open the program properly now and we can get to the next part of this tutorial.

4. Opening & Closing

If you need to CLOSE it, you can go to the CMD window and hit CTRL+C then Select Y like the image below:

Just hit Y and Enter. If your language is different, it will be the equivalent to YES or NO, so for spanish, for example, it's probably "S".

Now you can close that browser window because it will not work anymore.

Okay, now you can start this in 2 ways.
If you need to configure again or reinstall. You can go to your kohya_ss folder and run setup.bat:

You will be taken to this screen again, so if you want to open you can select 5.

If you need to configure again, select 4. If you need to reinstall select 1.

Another way (FASTER) to open this is by opening gui.bat:

It's the same as selecting option 5 from previous window.

5. Update

Now just one more little thing. If you want to update kohya_ss, you can do it very quickly.

First select the adress bar again like you did when installing, but now inside the kohya_ss folder.

Now paste this code:

git pull

If it's updated, it will appear a quick black window. If not it will download some files.

You can re-run the installation by selecting the setup.bat and option 1 again to be sure it's all good.

NOTE: You can check info from kohya_ss on their page: https://github.com/bmaltais/kohya_ss

All the info about it that I mention here is in there too.

That's all for this part of the tutorial. Now we should prepare your folder setup and I'll explain about the functions that you will need to know.

Next part here: LINK

Comments

Parkun

Thanks for that's knowledge 😇

Heinz

Oh that tutorial will be a good read tomorrow.