One click deployment

What is Kohya_SS
Kohya_SS is a python library designed for optimizing and fine-tuning diffusion models like Stable Diffusion. It stands out for its streamlined training process, making it accessible even to users with limited computational resources. Through advanced techniques like LoRA (Low-Rank Adaptation), Kohya_SS enables efficient model training with minimal resource requirements.
Key Features
-
Intuitive training interface:Professional GUI with automated parameter management and CLI generation, streamlining model training workflow for AI image generation models.
-
Smart resource optimization: Advanced GPU optimization enables high-quality training on consumer hardware, reducing resource requirements while maintaining professional results.
-
Flexible Model Development: Supports both new model training and pre-trained model fine-tuning with custom datasets, enabling specialized AI image model creation.
-
LoRA Integration: Implements Low-Rank Adaptation for memory-efficient model training, reducing computational demands while preserving output quality.
-
Architecture Support: Optimized for modern diffusion models like Stable Diffusion and SDXL, ensuring seamless integration and superior performance.
How to Train SDXL Models in Kohya_SS: Step-by-step Guide
What is SDXL
SDXL (Stable Diffusion XL) revolutionizes AI image generation with its state-of-the-art architecture. As the latest evolution in diffusion model technology, it delivers superior image quality, enhanced detail rendering, and unprecedented creative control. Kohya_SS's native SDXL support provides professional-grade training capabilities, enabling advanced model customization and fine-tuning for high-resolution, photorealistic AI art creation.
How to Fine-Tune SDXL with Kohya_SS
To effectively fine-tune an SDXL model using Kohya_SS, adhere to the following streamlined process:
-
Prepare your dataset: Curate a high-quality dataset with accurately paired images and descriptive captions. This step is crucial for training the model to understand and generate complex visual concepts.
-
Optimize with LoRA: Utilize Kohya_SS's support for LoRA to perform fine-tuning with minimal resource investment. This technique is pivotal for reducing the GPU memory footprint and accelerating training cycles.
-
Monitor and refine: Keep a close eye on the training progress using Kohya_SS's intuitive interface. Fine-tune hyperparameters to refine the model's performance and achieve the desired output quality.
How to Use LoRA with Kohya_SS: Beginner-Friendly Guide
What is LoRA Fine-Tuning
LoRA (Low-Rank Adaptation) revolutionizes AI model customization through innovative matrix decomposition techniques. This cutting-edge technology, integrated seamlessly into Kohya_SS, enables efficient model fine-tuning while dramatically reducing computational demands.
How to Train LoRA Models with Kohya_SS
Here’s a streamlined guide to fine-tuning your models using LoRA within Kohya_SS:
-
Prepare Your Dataset: Ensure your images and captions are properly organized and formatted to meet Kohya_SS requirements.
-
Configure Settings: Adjust the learning rate, batch size, and rank based on your GPU’s capacity and dataset size to maximize efficiency.
-
Start Training: Run the training script in Kohya_SS. LoRA fine-tunes only specific parts of the model, reducing memory usage and speeding up the process.
-
Monitor Progress: Keep an eye on loss metrics throughout training. Kohya_SS provides tracking tools to help you fine-tune settings for better results.
-
Discover how to install Kohya SS GUI and perform LoRA training with SDXL. Watch the full video if you're interested!
-
If you want to learn how to finetune the SDXL base model using only 10-15 images, check out the complete video for more information.
How to Use Kohya_SS GUI: Complete Tutorial
What is Kohya_SS: GUI
Kohya's GUI leverages Gradio to provide an intuitive visual interface for Stable Diffusion model training. This comprehensive frontend transforms complex command-line operations into a streamlined, point-and-click workflow.
How to Start GUI Service
1. Prerequisites
-
Ensure you have venv support (
apt install python3.10-venv
on Ubuntu 22.04) -
Install CUDA 11.8 Toolkit (follow official instructions)
-
Python version 3.10.9 or higher (but lower than 3.11.0)
2. Setup
-
Clone the repository:
git clone --recursive
https://github.com/bmaltais/kohya_ss.git
-
Navigate to the directory:
cd Kohya_SS
-
Run the setup script:
./setup.sh
(use./setup.sh -h
for help)
3. Run the GUI
To launch the GUI service, you can use the provided scripts or run the kohya_gui.py
script directly. Use the command line arguments listed below to configure the underlying service.
1--listen # Specify the IP address to listen on for connections to Gradio. 2--username # Set a username for authentication. 3--password # Set a password for authentication. 4--server_port # Define the port to run the server listener on. 5--inbrowser # Open the Gradio UI in a web browser. 6--share # Share the Gradio UI. 7--language # Set custom language.
3.1 Launching the GUI on Windows
On Windows, you can use either the gui.ps1
or gui.bat
script located in the root directory. Choose the script that suits your preference and run it in a terminal, providing the desired command line arguments. Here's an example:
1gui.ps1 --listen 127.0.0.1 --server_port 7860 --inbrowser --share
or
1gui.bat --listen 127.0.0.1 --server_port 7860 --inbrowser --share
3.2 Launching the GUI on Linux and macOS
To launch the GUI on Linux or macOS, run the gui.sh
script located in the root directory. Provide the desired command line arguments as follows:
1gui.sh --listen 127.0.0.1 --server_port 7860 --inbrowser --share
How to Run Kohya_SS: GUI on Novita AI
Step 1: Access GPU Instance Control Panel
-
Navigate to the
GPU menu
in the top navigation bar. -
Click
Get Started
to enter the GPU Instance control interface.
Step 2: Select Kohya_SS:GUI Template
-
Locate and select the Kohya_SS
:GUI
official template. -
Click
Deploy
button under the 4090 GPU card option to enter the instance creation page.
Step 3: Configure Disk Parameters and Review Configuration Settings
-
On the left panel, adjust the disk settings as needed:
-
Set appropriate system disk size;
-
Configure local disk capacity based on your storage needs.
-
-
Check the right panel for configuration options:
-
Verify image settings are correct;
-
Confirm startup commands are properly configured;
-
Ensure ports and environment variables meet your requirements.
-
-
Confirm all settings are correct and then click the
Next
button to advance to the final confirmation page.
Step 4: Proceed to Confirmation and Deploy Your Instance
-
Review the complete instance configuration summary.
-
Verify the cost details displayed on this page.
-
Click
Deploy
to initiate the deployment process.
Step 5: Wait as the System Creates Your Instance
Step 6: Monitor Deployment Progress and Track Image Download
-
After deployment, the system will automatically redirect you to the instance management page.
-
Your new instance will display
Pulling
status while downloading the image. -
After clicking the arrow icon next to your instance name, the instance details panel will be expanded with the image download progress in real-time.
-
Once image downloading completes, instance will change status from
Pulling
toRunning
.
Step 7: Check Instance Logs
-
Click the
Logs
button on your instance and selectInstance Logs
from the available options. -
Observe the Kohya_SS service startup process in the logs and wait for confirmation that all services have loaded successfully.
Step 8: Connect to Your Instance
-
Close the logs view when ready and click the
Connect
button to view connection options. -
View various connection methods: SSH, TCP, and HTTP of your instance.
-
For Kohya_SS GUI access, focus on the HTTP connection details. Therefore, in the Connection Options section, click
Connect to HTTP Service
and access to a new browser tab or window.
Step 9: Begin Using Your Instance
-
Allow a few moments for the web interface to fully load and get ready to run Kohya_SS:GUI on Novita AI.
Frequently Asked Questions
What is the advantage of using the GUI over the CLI?
The GUI offers a user-friendly interface for setting training parameters and generating commands, simplifying the training process for users who are not comfortable with the command line.
Does the GUI support training on macOS?
While macOS support is included in the project, it might not function perfectly. It's recommended to use Linux for reliable training.
How can I customize the training parameters?
The GUI allows you to directly set various training parameters through its interface.
Where can I find more information about troubleshooting?
The README file covers troubleshooting steps for common issues like page file limits and missing modules.
Lisence
- Apache-2.0 License.
View on Github
Source site: https://github.com/bmaltais/kohya_ss
Get in Touch
-
Email: iris@novita.ai
-
Discord: novita.ai
About Novita AI
Novita AI is an AI cloud platform that offers developers an easy way to deploy AI models using our simple API, while also providing an affordable and reliable GPU cloud for building and scaling.
Other Recommended Templates
Meta Llama 3.1 8B
Accelerate AI Innovation with Meta Llama 3.1 8B Instruct, Powered by Novita AI
MiniCPM-V-2_6
Empower Your Applications with MiniCPM-V 2.6 on Novita AI.
stable-diffusion-3-medium
Transform Creativity with Stable Diffusion 3 Medium on Novita AI
Qwen2-Audio-7B-Instruct
Empower Your Audio with Qwen2 on Novita AI
Llama3.1-8B
Run Llama3.1-8B with SGlang on Novita AI
Building an AI startup? Get up to $10,000 in credits!
Get up to $10,000 in credits and dedicated support to grow and scale your AI startup.
Apply Now