How To Do Stable Diffusion Lora Training In ComfyUI (Tutorial Guide)
TLDRThis tutorial guides users through training LoRA models in ComfyUI using custom nodes from GitHub. It explains how to install necessary custom nodes for both image captioning and model training, including the WD 1.4 node for generating image-to-text prompts. The video covers essential steps like preparing images, generating captions, and configuring the training process using either simple or advanced modes. The process is streamlined, making it easier and faster compared to previous methods, and the trained LoRA models are saved in the ComfyUI's folder structure for future use.
Takeaways
- π» This tutorial explains how to use a custom node in ComfyUI to train LoRA models easily.
- βοΈ The custom node can be found on GitHub, with detailed descriptions of its functionality.
- π§ There are two modes available for training LoRA: a simple mode and an advanced mode with more customization options.
- π Before training, you need to install two custom nodes: one for LoRA training and one for image captioning.
- π After installation, restart ComfyUI to apply changes and have the new workflow available.
- π The image captioning node allows for batch image captioning, creating text files for each image to be used in LoRA training.
- π To install dependencies, copy commands from GitHub and run them via the command prompt.
- πΌοΈ LoRA training is demonstrated with a model such as SD 1.5, where the LoRA model is saved in a specified folder.
- π This method simplifies the training process compared to previous approaches, saving time and effort.
- π The output LoRA files will be saved in the 'models/LoRA' subfolder in ComfyUI after training.
Q & A
What is the main purpose of this tutorial?
-The tutorial aims to guide users through the process of training LoRa models using a custom node in ComfyUI.
What is the first step in the LoRa training process in ComfyUI?
-The first step is to install the LoRa training ComfyUI custom nodes from the GitHub project.
What should you do after installing the custom node package?
-After installing the package, you need to restart ComfyUI for the changes to take effect.
Where can you find the LoRa training options in ComfyUI?
-You can find the LoRa training options by right-clicking in the ComfyUI interface and selecting the 'Loras' sub-menu.
What is the difference between the simple and advanced LoRa training modes?
-The simple mode is easier to use, while the advanced mode provides more options for customization and exploration.
What is the purpose of the image captioning custom node in ComfyUI?
-The image captioning custom node is used to create captions for images, which are necessary for preparing data to train LoRa models.
What additional installation is needed for image captioning in ComfyUI?
-You need to install the 'WD 1.4' model, which allows for generating text prompts from images.
What does the workflow for image captioning involve?
-The workflow involves loading a folder of images, generating captions using the custom node, and saving the captions as individual text files.
How does the script handle multiple images for captioning?
-For each image, a separate text file is created with the corresponding text prompt, saving it in a designated folder.
What are the final steps to train a LoRa model using ComfyUI?
-You select the desired model, specify the output folder, and start the training process. The trained LoRa file is saved in the 'models' folder within ComfyUI.
Outlines
π₯οΈ Introduction to Custom Node for Training LoRA in ComfyUI
In this tutorial, we learn how to use a custom node from a GitHub project to easily train LoRA models using ComfyUI. The GitHub page offers detailed instructions on how the node works, what models it can train, and the simple steps to follow. First, we install the LoRA training custom nodes, which, once installed, will require restarting ComfyUI. Then, we can access the new LoRA sub-menu from the right-click menu. There are two modes: a simple one and an advanced one, with the latter offering more customization options. The tutorial explains that TensorBoard is unnecessary for the workflow but emphasizes the installation of image captioning custom nodes for preparing images used in LoRA model training.
π Workflow for Image Captioning with ComfyUI
The next step in the process involves using image captioning in ComfyUI. After installing the captioning custom nodes from the GitHub repository, the user can duplicate an example workflow to set up four custom nodes for image caption generation. These nodes are necessary to caption images for LoRA training. Once the custom nodes are installed, they must be connected properly in the workflow, and the WD 1.4 model is installed to process image-to-text prompts. The workflow generates text files, each corresponding to an image, and saves them in the specified folder. The tutorial highlights that this method simplifies the process of captioning large batches of images for LoRA preparation.
Mindmap
Keywords
π‘ComfyUI
π‘LoRa training
π‘Custom node
π‘Image captioning
π‘SD 1.5
π‘Workflow diagram
π‘Hugging Face demo
π‘Tensor board
π‘WD 1.4
π‘Text prompts
Highlights
Overview of how to use ComfyUI custom nodes to train LoRA easily.
GitHub page provides descriptions of models it can train and simple steps for LoRA training.
The tutorial demonstrates the ease of using one custom node for LoRA training.
ComfyUI offers another custom node for creating image captions in preparation for LoRA training.
First essential step is installing the ComfyUI LoRA training custom nodes.
Restart ComfyUI after installation to begin a fresh workflow.
Right-click menu reveals options to select and train LoRA models.
The advanced mode offers additional options for LoRA training.
Before starting LoRA training, install image captioning nodes from the same GitHub project.
Basic workflow for image captioning involves generating captions for images used for LoRA models.
WD 1.4 custom node facilitates image-to-text conversion, which is crucial for training.
Steps to load prepared image folders and generate captions for each image using the custom nodes.
Batch image captioning is a significant feature of the ComfyUI LoRA preparation workflow.
LoRA files are saved in the models subfolder after training completion.
ComfyUI's LoRA training process is more time-saving compared to older methods.