In this tutorial, we'll walk you through the process of training a LoRA model using Kohya_ss. From image preparation to the final training process, this guide will cover all the essential steps to help you achieve high-quality results. Let's dive in!
Step 1: Preparing Your Images
1. Number and Size of Images
- Quantity: Aim to gather 20 to 100 images.
- Recommended Size: For best results, use images with a resolution of 1024x1024 pixels. A 512x512 pixel resolution is also acceptable, but higher resolutions will yield better quality.
- Volume: A few dozen images are sufficient for effective training.
2. Image Quality
- Resolution: Ensure images are of moderate resolution. Avoid using very small or low-quality images.
3. Thematic Consistency
- Unified Theme: Your dataset should maintain a consistent theme and style. Avoid images with complex backgrounds or unrelated characters that could confuse the model.
4. Diversity in Angles and Expressions
- Multiple Perspectives: Include images showing the character(s) from various angles, with different facial expressions and body poses.
5. Emphasis on Facial Features
- Focus: Include more images that emphasize facial features.
- Full-Body Shots: Use a smaller proportion of full-body images to maintain focus on the character's face.
Step 2: Uploading Images via Cloud Storage
1. Upload Your Image Package
- Compress Your Images: Zip your images into a single archive.
- Naming Convention: Name the file using the format
x_name
, where "x" represents the step number.
2. Extract the Folder
- Unzip: Once uploaded to the cloud, extract the contents of the ZIP file.
Step 3: Tagging Your Images
1. Using Kohya_ss for Tagging
- Tool Selection: Use the WD14 captioning tool within Kohya_ss for tagging your images.
2. Tagging Process
- Directory Selection: Choose the folder containing your images.
- Captioning: Click on Caption Images to start the tagging process.
- Monitoring: You can track progress in the Log tab or check for
.txt
files in your image folder to ensure tagging is complete.
Step 4: Initiating LoRA Training
1. Access the LoRA Training Tab
- Navigation: Go to the LoRA tab in Kohya_ss to begin setting up your training environment.
2. Configuring Paths
- Config Path: Set the appropriate Config path for your training.
- Model and Resources: Select the base model, specify the image resource path, and name your output model.
- Output Directory: Define where the trained model will be saved.
Step 5: Configuring LoRA Training Parameters
1. Setting Epochs
- Training Cycles: Define the number of epochs (complete passes over the dataset). For most projects, 5 to 10 epochs are recommended, depending on the number of images.
2. Max Training Steps
- Speed Consideration: Configure the maximum training steps to balance training speed and model quality.
3. Start Training
- Initiate Process: Once all parameters are set, start the training process and let the model learn from your data.
Step 6: Monitoring Training Progress
1. Check Training Status
- Log Tab: Keep an eye on the Log tab to monitor progress and ensure everything is running smoothly.
Final Note:
For a deeper understanding of the various training parameters in Kohya_ss, check out the official Kohya_ss LoRA Training Parameters Guide.
With this guide, you're well on your way to training your own LoRA models with Kohya_ss. Happy training!