OneTrainer Training SDXL LoRas

Posted: 2024-5-28

Setting up OneTrainer might seem daunting at first, but most of the settings are already configured for you. Simply prepare your images and metadata, create a concept, and you’ll be training LoRAs like a pro in no time.

Prerequisites

Before you begin, ensure you have:

Preparing Images

First, start collecting images of the subject you want to train. This could be anything from a video game character or a TV movie star to a type of architecture. Then you want to edit the metadata of the images before using them for training.

Things to Consider When Preparing Images for Training

Number of Images

Datasets

Create a dedicated folder to store all the images you plan to use for training.

D:/
└── datasets/
    └── projectName/
        └── images/

Captions

You can create a text file with the same name as each image. For this demo, I’m creating a single text file and using it for all the images during training, since the pictures are all similar in nature.

donald trump, presidential election, suit, tie

Dataset File Demonstration

Step 1: Launching OneTrainer

To start OneTrainer, run start-ui.bat file. If you see warnings in the terminal, don’t worry—everything should still work fine.

Step 2: General Tab

OneTrainer General Tab

  1. Create a directory to store all the trained data, so consider using a large storage drive to accommodate the data size. Keep in mind that once you start training, more files will be added to this directory.
D:/
└── workspace/
    └── cache/
  1. In the upper left corner, near the OneTrainer logo you’ll find a dropdown menu. Click on it and select #sdxl 1.0 LoRa from the list.

  2. Under the general tab change the Workspace Directory to your preferred location.

  3. Set the Cache Directory to the same path to ensure all files are stored on the same drive. This helps keep your data organized and easily accessible.

Step 3: Model Tab

OneTrainer Model Tab

  1. Download the SDXL base model or select another model you would like to train from.

  2. Under the “Model Output Destination” section, you can rename the LoRA model or keep the default name. Please note that when the model is created, it will be saved in the OneTrainer model folder.

Step 4 Concepts Tab

Click the “add concept” button and then double-click the newly created concept that was created. This will open the concept in a new popup window.

OneTrainer Concept Tab

  1. Name the concept
  2. Under Path click the 3 ... and select where the images are located.
  3. Change Prompt Source to From single text

Image Augmentation Tab

OneTrainer Augmentation Tab

  1. Optional, but I turned off Crop Jitter and Random Flip in the image augmentation tab.

Step 5 backup Tab

OneTrainer Backup Tab

  1. Lastly type in 1st-training in the Save Filename Prefix
  2. Change Save After to save every 20 EPOCH.

Start Training

If you made it this far, give yourself a pat on the back. Now you’re ready to click Start Training, and hopefully, everything goes smoothly as it begins downloading the necessary resources. Remember to check the terminal for the training process. Please ensure you have an active internet connection, as it’s essential for downloading the tokenizer JSON and text files.

LoRA Output

Here’s a couple of results generated with the newly created LoRA. Not bad, considering the images were hastily chosen from Google Images. I just wanted to demonstrate that it can be done with virtually anyone.

ComfyUI Trump LoRa Output
ComfyUI Trump LoRa Output