In this tutorial, we'll explore how to train a LoRA model using Kohya_ss, a powerful tool for enhancing your stable diffusion projects. Whether you're looking to generate images with multiple concepts or simply want to refine your skills, this guide will take you through every essential step. Get ready to unlock your creativity and achieve stunning results!
Step 1: Preparing Your Images
1. Number and Size of Images
- Quantity: Aim to gather 20 to 100 images, considering the appropriate batch size for your training process.
- 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 all your 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 Image 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 folder path for your training.
- Model and Resources: Select the base model, specify the generated 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 training 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 dive into the various training parameters in Kohya_ss, be sure to explore the official Kohya_ss LoRA Training Parameters Guide. With this guide, youâre well-equipped to train your own LoRA models effectively. Plus, consider using MimicPC to seamlessly launch Kohya_ss and generate stunning images. If you still have questions or feel confused, check out our video blog for additional insights.