ComfyUI LoRA's - The ultimate guide (2024)

ComfyUI LoRA's - The ultimate guide (1)

Artists, designers, and enthusiasts may find the LoRA models to be compelling since they provide a diverse range of opportunities for creative expression. They are also quite simple to use with ComfyUI, which is the nicest part about them. In this article, we will demonstrate the exciting possibilities that are associated with LoRA models in ComfyUI.

What is a LoRA?

Stable Diffusion models are fine-tuned using Low-Rank Adaptation (LoRA), a unique training technique. It offers a solution that is particularly useful in the field of artificial intelligence art production by mainly addressing the issues of balancing the size of model files and training power. With LoRAs, users can make model customizations without putting a heavy strain on local storage resources.

An innovative approach has been developed to address these difficulties. LoRA approaches the adaptation of large-scale pre-trained language models in a novel way. The mechanism operates by imbuing each layer of the transformer architecture with trainable rank decomposition matrices and freezing the pre-trained model weights. By employing this novel methodology, the quantity of trainable parameters is drastically diminished, resulting in enhanced operational effectiveness during both the training and inference stages. LoRA enables the scalable execution of AI model integrations into practical tasks, presenting potential resolutions to current obstacles in the implementation of generative AI models.

The LoRA Theory

A method known as the UNet algorithm is employed in the series of computations that make up one of LoRA's hypotheses. The data is input into the left side, which is then used to do a series of computations; the data is then shown on the right side. The picture's long bars show the computing steps. The effect of the produced images can be altered by modifying the output results, which are achieved by altering the parameter weights inside the pillars. Without affecting any one function, LoRA permits the injection of parameters into any existing layer. The original model is unharmed, it's plug-and-play, and the model is compact, which is advantageous.

ComfyUI LoRA's - The ultimate guide (2)

To understand LoRA's, it's helpful to think of it like a "filter" for a camera. You can see that the Prompt and Seed models are identical in the two pictures down below. On one side, we have the original image without any LoRA effects applied, and on the other, we have the image with the LoRA effect applied in a sketch manner.

ComfyUI LoRA's - The ultimate guide (3)

Where to get LoRA’s?

Civitai

Civitai has a thriving community where you can always find fresh and exciting models. To find LoRA models, just simply follow these steps.

  1. Go to civitai.com and search for models.
ComfyUI LoRA's - The ultimate guide (4)
  1. Click the Filters > Check LoRA model and SD 1.5 base model and after setting the filters, you may now choose a LoRA.
ComfyUI LoRA's - The ultimate guide (5)
  1. Click download either on that area for download. Be sure to remember the base model and trigger words of each LoRA.
ComfyUI LoRA's - The ultimate guide (6)
  1. Save your LoRA files (SAFETENSORS File format) because you can use these in your instance of ThinkDiffusion.

HuggingFace

  1. Usethis when searching for LoRA’s.
  2. Make sure that the LoRA keyword is used, and the Stable Diffusion left panel filter is selected.
ComfyUI LoRA's - The ultimate guide (7)
  1. Choosea LoRA from thislist of models available. You can determine whatkind of LoRA they are according to the arrowed selection.
ComfyUI LoRA's - The ultimate guide (8)
  1. For example, in the anime-detailer-xl-lora that was selected, it will redirect you to the LoRA page and you will see a Model Card tab which explains the overview, model details and installation process. The right-hand side shows the trigger words that can be used in the text prompt node.
ComfyUI LoRA's - The ultimate guide (9)
  1. In the Files and version tab, you can see the list of files and you can download specifically the SAFETENSORS file.
ComfyUI LoRA's - The ultimate guide (10)

Other sources of LoRA's

Some of the websites like https://prompthero.com/ai-models/lora and https://tensor.art/models may offer a download of LoRA models. Google, Github and Reddit are also helpful in providing LoRA's. But for now, let's hook up to those most visited community websites.

Getting Started with ComfyUI powered by ThinkDiffusion

ComfyUI LoRA's - The ultimate guide (11)

Load LoRA

Download workflow here: Load LoRA

  1. To use your LoRA with ComfyUI you need this node:
ComfyUI LoRA's - The ultimate guide (12)

For loading a LoRA, you can utilize the Load LoRA node. By adjusting the LoRA's, one can change the denoising method for latents in the diffusion and CLIP models. Examples of common use-cases include improving the model's generation of specific subjects or actions, or adding the ability to create specific styles. To make even more changes to the model, one can even link several LoRA's together.

You have the option to set the LoRA strength settings to negative numbers. Occasionally, this can lead to fascinating outcomes.

  1. Look for a LoRA to be used. For tutorial purposes, let's use Princess Zelda LoRA from Civitai.com. https://civitai.com/models/4959?modelVersionId=5713
ComfyUI LoRA's - The ultimate guide (13)
  1. Check the right panel of Princess Zelda LoRA page before downloading it. Make sure to check it has good reviews, base model, trigger words and LoRA stats.
ComfyUI LoRA's - The ultimate guide (14)
  1. After downloading the SAFETENSOR file of Princess Zelda. Launch the ComfyUI machine from ThinkDiffusion.
ComfyUI LoRA's - The ultimate guide (15)
  1. Upload Princess Zelda LoRA into the ComfyUI machine.The upload feature can beseen on the right side of the ComfyUI machine. If hidden just click the My Files icon at the bottom corner of the browser in order to pop-up the upload panel. Then follow the sequence of folders: comfyui > models > Lora >
ComfyUI LoRA's - The ultimate guide (16)
ComfyUI LoRA's - The ultimate guide (17)
  1. Restart the ComfyUI machine so that the uploaded file takes effect. You can click the Restart UI, or you can go to My Machines and stop the current machine and relaunch it ( Step 4).
ComfyUI LoRA's - The ultimate guide (18)
  1. In the ComfyUI, add theLoad LoRA node in the empty workflow or existing workflow by right clicking the canvas > click the Add Node > loaders > Load LoRA. The other way is by double clicking the canvas and search for Load LoRA.
ComfyUI LoRA's - The ultimate guide (19)
ComfyUI LoRA's - The ultimate guide (20)
  1. Once the Load LoRA node appears, connect it to other existing nodes. Connect it by using the same INPUT and OUTPUT to other nodes by simply dragging the point and the connecting wires will appear.
ComfyUI LoRA's - The ultimate guide (21)
  1. This is the final setup of the workflow that has a Load LoRA node and is connected to other nodes. Make sure you have selected the correct LoRA_name parameters in Load Lora nodeand trigger words in the Text Prompt node.
ComfyUI LoRA's - The ultimate guide (22)
  1. After the workflow has been setup with the Load LoRA node, click the Queue Prompt and see the output in the Save Image node.
ComfyUI LoRA's - The ultimate guide (23)

Multiple LoRA’s

Download workflow here: Multiple LoRAs

Yes, you heard itright. You can add multiple LoRA's in a single workflow.

  1. Look for new LoRAs in websites such as civitai.com and huggingspace.co and download it and upload the SAFETENSOR files to the My Files of ThinkDiffusion. You can follow the steps here:- Where to Get LoRA?. You can add a desired model to your existing workflow such as hand position LoRA, background LoRA, image effects LoRA, etc.
  2. Go to your workflow and add new LoRA nodes beside the existing LoRA node.
ComfyUI LoRA's - The ultimate guide (24)
  1. Connect the multiple LoRA nodes in a series connection. Observe the circled selection as it shows the connected input / output colors.
ComfyUI LoRA's - The ultimate guide (25)
  1. Set the correct LoRA within each node and include the relevant trigger words in the text prompt before clicking the Queue Prompt. I’m using the princess Zelda LoRA, hand pose LoRA and snow effect LoRA. The example below executed the prompt and displayed an output using those 3 LoRA's.
ComfyUI LoRA's - The ultimate guide (26)

LoRA Stack

Download workflow here: LoRA Stack

By default, there is no stack node in ComfyUI. All you need to do is to install it using a manager. LoRA Stack is better than the multiple Load LoRA node because it is compact, saves space and reduces complexity. Below are thesteps on how to get the LoRA Stack nodeand how to use it in the workflow.

  1. Go to Manager
ComfyUI LoRA's - The ultimate guide (27)
  1. Click Install Custom Nodes
ComfyUI LoRA's - The ultimate guide (28)
  1. Search for “comfyroll” in the search box and check the list of available nodes below and click the install.
ComfyUI LoRA's - The ultimate guide (29)
  1. Don’t forget to restart the ComfyUI machine for the newly installed custom node to take effect. If the node is not yet available in the node list even though the RESTART was already clicked, just click the stop button and relaunch the machine.
ComfyUI LoRA's - The ultimate guide (30)
  1. Search the LoRA Stack and Apply LoRA Stack node in the list and add it to your workflow beside the nearest appropriate node.
ComfyUI LoRA's - The ultimate guide (31)
ComfyUI LoRA's - The ultimate guide (32)
  1. The image below is the workflow with LoRA Stack added and connected to the other nodes.
ComfyUI LoRA's - The ultimate guide (33)
  1. Before clicking the Queue Prompt, be sure that the LoRA in the LoRA Stack is Switched ON and you have selected your desired LoRA. As an example, I used Princess Zelda LoRA, Heart Hands LoRA and Snow Effect LoRA. You can follow this workflow and save the output as many times as you like.
ComfyUI LoRA's - The ultimate guide (34)

LoRA in Efficient Node

Download workflow here: LoRA in Efficient Node

By default, there is no efficient node in ComfyUI. All you need to do is to install it using a manager. Advanced ComfyUI users use efficient node because it helps streamline workflows and reduce total node count. Below are thesteps on how to get the Load LoRA within the Efficient Loader and how to use it in the workflow.

  1. Go to Manager
ComfyUI LoRA's - The ultimate guide (35)
  1. Click Install Custom Nodes
ComfyUI LoRA's - The ultimate guide (36)
  1. Search for “efficiency” in the search box and check the list of available nodes below and click the install.
ComfyUI LoRA's - The ultimate guide (37)
  1. Don’t forget to restart the ComfyUI machine to take effect on the newly installed custom node. If the node is not yet available in the node list even though the RESTART was already clicked, just click the stop button and relaunch it.
ComfyUI LoRA's - The ultimate guide (38)
  1. Search the Efficient Loader and KSampler (Efficient) node in the list and add it to the empty workflow.
ComfyUI LoRA's - The ultimate guide (39)
ComfyUI LoRA's - The ultimate guide (40)
  1. The image below is the empty workflow with Efficient Loader and KSampler (Efficient) added and connected to each other nodes.
ComfyUI LoRA's - The ultimate guide (41)
  1. Another Example and observe its amazing output. Be sure to check the trigger words before running the prompt.
ComfyUI LoRA's - The ultimate guide (42)

Training a LoRA (Difficult Level)

For those of you who are ambitious, and want to make your own LoRA, there are 2 guides that you can use to train your own LoRA.

Super simple LoRA training guide

This is a super simple guide for anyone who wants to dive straight in and use the .json settings attached in the guide. You can start training a LoRA within 10 to 20 mins and you don’t have to worry about learning all of the settings, trying to understand what it all means.

https://learn.thinkdiffusion.com/a-super-simple-guide-to-lora-training-on-kohya/

Detailed, in depth, LoRA training guide

This guide is more in depth and attempts to explain what each field does within the Kohya_ss user interface. This is a longer tutorial and requires more time to read and understand the content.

https://learn.thinkdiffusion.com/creating-sdxl-lora-models-on-kohya/

If you’re having issues with installation or slow hardware, you can try any of these workflows on a more powerful GPU in your browser withThinkDiffusion.

TRY THINKDIFFUSION

If you enjoy ComfyUI and you want to test out different workflows, then feel free to check out these 10 cool ComfyUI workflows here.

ComfyUI LoRA's - The ultimate guide (2024)
Top Articles
Latest Posts
Article information

Author: Gov. Deandrea McKenzie

Last Updated:

Views: 5686

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Gov. Deandrea McKenzie

Birthday: 2001-01-17

Address: Suite 769 2454 Marsha Coves, Debbieton, MS 95002

Phone: +813077629322

Job: Real-Estate Executive

Hobby: Archery, Metal detecting, Kitesurfing, Genealogy, Kitesurfing, Calligraphy, Roller skating

Introduction: My name is Gov. Deandrea McKenzie, I am a spotless, clean, glamorous, sparkling, adventurous, nice, brainy person who loves writing and wants to share my knowledge and understanding with you.