BlogAI models

What is a LoRA? How it works, and how to use one in ComfyUI

A LoRA is a small file that changes what a big image model does. What's inside one, where it goes in a ComfyUI workflow, and how to set its strength.

Esha Senior AI Developer
Updated 13 min readTested on ComfyUI 0.37.1

On this page12 sections

The short version

  • A LoRA is a small file of changes for a model you already have. The model on your disk stays exactly as it was; ComfyUI adds the changes when it loads it.
  • It's small because each change is stored as two thin strips of numbers instead of a full copy. The LoRA in this guide holds 347 million numbers. The model it changes holds 11.9 billion.
  • It only works with the model family it was trained for. A FLUX LoRA does nothing useful on SDXL, and the other way round.
  • In ComfyUI it sits on the model wire, between the model loader and KSampler.
  • Strength isn't a quality dial. The LoRA below looks best at 0.125, turns into a different picture at 0.5 and never forms an image at all at 1.0.

Spend ten minutes on Civitai or Hugging Face and you'll find far more LoRAs than models. People use them to teach a model one person's face, a product, a painter's brushwork or a film look. Some do something less obvious, like getting a finished picture out of the model in fewer steps.

In the video I described a LoRA as a small add-on you load on top of your main model. That's the right way to think about it. This guide fills in the rest: what's actually inside the file, why it's so small, where it goes in a ComfyUI workflow, and how to set it so it helps rather than wrecks the picture. Every render here is real, made with the image workflow from the video and one LoRA added to it.

What a LoRA is

An image model is billions of numbers, called weights, that were learned during training. FLUX.1 [dev] has 11.9 billion of them. Teaching it something new the traditional way means adjusting all of those numbers and saving a complete new copy of the model: another 23.8 GB file, and a training run that needs serious hardware.

A LoRA takes a shortcut. It leaves the original weights frozen and learns only a small set of changes to them. When you generate, ComfyUI adds those changes on top, and the model behaves as if it had been retrained. Take the LoRA away and you have the original model back, untouched.

The name stands for Low-Rank Adaptation. It comes from a 2021 paper by researchers at Microsoft, written for language models, where it cut the number of numbers you have to train to fine-tune GPT-3 by a factor of 10,000. In December 2022 it was applied to Stable Diffusion, and a fine-tune you could share as a few megabytes instead of a few gigabytes caught on fast.

Why a LoRA file is so small

Here's a real one: Hyper-FLUX.1-dev-16steps-lora.safetensors, made by ByteDance for FLUX.1 [dev]. A .safetensors file starts with a list of everything inside it, so you can count what a LoRA contains without loading it. I did, for the LoRA and for the model it was made for:

FLUX.1 [dev]The LoRA
File size23.8 GB1.39 GB
Numbers inside11.9 billion347 million, 2.9% as many
What they are780 weight tensors504 pairs of thin strips, one pair per layer it changes

Each layer of the model is a grid of numbers. The LoRA doesn't store a changed copy of each grid. It stores two thin strips, and multiplying one by the other gives a full grid of changes, the same shape as the original. Drawn to scale, the difference looks like this:

One layer of FLUX.1 dev beside the two strips a LoRA stores for it, drawn to scale. The layer is a 3,072 by 4,096 grid of 12.6 million numbers. The LoRA stores a 3,072 by 64 strip and a 64 by 4,096 strip, 458,752 numbers, whose product is a grid of changes the same shape as the layer. One layer of FLUX.1 [dev], to scale W The layer: 3,072 × 4,096 12,582,912 numbers + A: 64 × 4,096 B: 3,072 × 64 B × A the change, worked out when the LoRA loads What the LoRA stores: A and B 458,752 numbers, 3.6% of the layer
The layer that reads FLUX's text encoder output, and what this LoRA keeps for it. The two orange strips are all that's stored; the dashed grid is what they multiply out to.

That 64 is the LoRA's rank: the width of the strips. It's chosen when the LoRA is trained. A higher rank can hold more detail and makes a bigger file. This one uses rank 64 on every layer and stores its numbers at full 32-bit precision, which makes it large for a LoRA. Most LoRAs you'll download use a lower rank and 16-bit numbers, so FLUX LoRAs usually run from tens to a few hundred megabytes, and a Stable Diffusion 1.5 LoRA can be just a few megabytes.

The sum ComfyUI does For every layer the LoRA covers: new weights = original weights + strength × (B × A). If the file also stores an alpha value, ComfyUI multiplies by alpha ÷ rank as well. This one doesn't, so strength scales the change directly, and a strength of 0 gives you the original model exactly.

What people use LoRAs for

  • A style. A painter's brushwork, a film stock, a flat illustration look. The example in the video was a fashion-editorial look you want on every image, without switching to a different main model.
  • A character or a person. The same face, hair and build from one picture to the next, which a prompt alone is bad at.
  • A product or an object. One particular bag, trainer or bottle, drawn the way it really looks.
  • A concept. A pose, a camera angle, a kind of lighting or a piece of clothing the model doesn't know well.
  • Speed. Hyper, Lightning and Turbo LoRAs teach a model to finish in fewer steps. The LoRA in this guide is one of these.

You'll also come across variants called LoHa, LoKr, OFT and DoRA. They store their changes a little differently, but ComfyUI loads them all the same way: same folder, same node.

Where a LoRA goes in a ComfyUI workflow

In the workflow guide, the model path was a single wire: Load Diffusion Model straight into KSampler. A LoRA goes on that wire.

The FLUX.1 Krea workflow in ComfyUI with a Load LoRA node between Load Diffusion Model and KSampler: lora_name Hyper-FLUX.1-dev-16steps-lora.safetensors, strength_model shown as 0.13, KSampler at 8 steps, and the finished portrait in Save Image.
The video's image workflow with one node added, the exact graph behind the 8-step render further down. MODEL leaves the loader, passes through Load LoRA and goes on to KSampler. The strength box shows two decimal places, so the 0.125 it's set to reads as 0.13.

The node is Load LoRA (its internal name is LoraLoaderModelOnly). A MODEL goes in, a changed MODEL comes out, and it has two settings: lora_name, the file, and strength_model, how strongly to apply it. Strength starts at 1.0 and accepts anything from −100 to 100.

Two LoRA nodes ComfyUI has a second one, Load LoRA (Model and CLIP), which also runs the text encoder through the LoRA with its own strength_clip. It's for LoRAs trained with text-encoder changes, which is common with SD 1.5 and SDXL: wire the checkpoint's CLIP through it and on to your CLIP Text Encode nodes. LoRAs for FLUX, Qwen-Image and WAN usually change only the diffusion model, so the model-only node is the one you'll use most.

Adding one, step by step

  1. Put the file in the loras folder

    That's ComfyUI/models/loras/. In the Desktop app it's %LOCALAPPDATA%\Comfy-Desktop\ComfyUI-Shared\models\loras. Then press R in ComfyUI so it notices the new file.

  2. Add the node

    Double-click an empty part of the canvas, type lora and pick Load LoRA.

  3. Put it on the model wire

    Drag from the loader's MODEL output to the LoRA's model input, then from the LoRA's MODEL output to KSampler's model input. The new wire replaces the old one, so KSampler now only gets the model through the LoRA.

  4. Pick the file and set the strength

    Use whatever the LoRA's download page recommends. If it doesn't say, 0.8 is a reasonable first try for a style or character LoRA.

  5. Add the trigger word, if it has one

    Many character and style LoRAs only switch on when a particular word is in the prompt. It's listed on the LoRA's page, often as "trigger words".

  6. Run it, then compare

    Select the LoRA and press Ctrl + B to bypass it. The model passes straight through, so with the seed fixed you get the same image without the LoRA. Press it again to switch the LoRA back on.

What a LoRA does to a real render

This is the image workflow from the video cut down to 8 steps instead of 20, run once without the LoRA and once with it, at the strength its makers recommend: 0.125. The prompt, the seed (429741262831993) and every other setting are the same in both.

The portrait at 8 steps without the LoRA: soft, hazy and unfinished. The portrait at 8 steps with the Hyper-FLUX LoRA at 0.125: sharp freckles, earrings and window light. without LoRA
8 steps
FLUX.1 Krea [dev], 8 steps, same seed. The only difference is the LoRA.

That's what this LoRA was trained to do: get FLUX to a finished picture in fewer steps. It doesn't know any faces or styles. A style LoRA changes what the picture looks like instead of how quickly it forms, but it gets into the model in exactly the same way.

One detail: this LoRA was made for FLUX.1 [dev], and I used it on FLUX.1 Krea [dev], the model in the video's workflow. Krea is built on the dev architecture, so it loaded without a single warning. Even so, a LoRA behaves most predictably on the exact model it was trained on.

Strength: the setting that makes or breaks it

Now the same portrait at 16 steps, the step count this LoRA was made for, with only the strength changing:

The portrait at 16 steps with no LoRA. The portrait at 16 steps with the LoRA at 0.125: the same woman, crisper, with stronger light. The render with the LoRA at 0.5: a different woman in flat, even light, with the sunlit window gone. The render with the LoRA at 1.0: nothing but coloured noise. strength 0.125
strength_model
Same prompt, seed and step count. Only the LoRA's strength changes.

Strength multiplies the LoRA's changes before they're added to the model. This one was trained to be used at about an eighth of full strength, so 0.5 adds four times what it was designed to add, and the model loses the picture it was making. At 1.0 the change is so large that sampling never gets to an image at all. Nothing is broken; the setting is just eight times too high.

That's an extreme case, but the lesson holds for every LoRA. Most style and character LoRAs are meant to be used somewhere between about 0.6 and 1.0, and some, like this one, far lower. The number on the LoRA's own page beats any rule of thumb. When there isn't one, fix the seed, try 0.8, then try either side of it.

Strength can also go below zero, which pushes the model away from what the LoRA learned. That's how "slider" LoRAs work: one file that makes something stronger with a positive strength and weaker with a negative one, such as the amount of detail in an image.

Using more than one LoRA

Chain them on the same wire: loader, first LoRA, second LoRA, KSampler. Each one adds its changes to the same weights, so the effects stack, and so does the risk of overdoing it.

  • Lower each one a little. Two LoRAs at 0.7 often look better than two at 1.0.
  • Don't make them fight. A character LoRA and a style LoRA usually get along. Two style LoRAs are both trying to decide the same thing.
  • Test one at a time. Bypass each with Ctrl + B in turn to see what it's adding.

Choosing a LoRA that will work

Before you download one, check five things on its page:

  1. The base model. It has to match yours: FLUX.1, FLUX.2, SDXL, SD 1.5, Qwen-Image and WAN are all different families. The layers don't line up across families, so a mismatched LoRA either fails to load or quietly does nothing.
  2. The trigger word, if there is one.
  3. The recommended strength. As you've seen, it can be far from 1.0.
  4. The licence. A LoRA carries the base model's licence terms, and its creator can add their own, such as no commercial use.
  5. The file type. Prefer .safetensors. It holds only numbers, while older .ckpt and .pt files use a format that can also carry code.

And if a LoRA is trained on a real person, only publish what you make with it if that person has agreed.

When a LoRA seems to do nothing

  • It's for a different model family. The console fills with lines that start lora key not loaded, one for every layer ComfyUI couldn't match to your model.
  • The wire goes around it. If KSampler's model input still comes from the loader, the LoRA is in the graph but not in the image.
  • The trigger word is missing from the prompt.
  • It's bypassed or muted. A bypassed node turns purple, a muted one goes grey. Check the node before you check anything else.
  • It also trained the text encoder and you're using the model-only node. Those lora key not loaded lines will mention the text encoder, usually with te in the name. Switch to Load LoRA (Model and CLIP).
  • The file doesn't appear in the list. It's in the wrong folder, or ComfyUI hasn't looked yet: press R.

Can you train your own?

Yes, and it's more approachable than it sounds. The usual starting point is a few dozen good, varied pictures of one subject or one style, each with a caption. ComfyUI now has training nodes of its own, Train LoRA with Make Training Dataset and Save Training Dataset, under model/training, and dedicated trainers such as AI Toolkit, kohya's sd-scripts and OneTrainer are popular for FLUX-sized models. Training deserves a guide of its own. The part that matters here is that what comes out is the same kind of file you've been loading in this one.

Questions people ask

What is a LoRA in AI image generation?

A LoRA (Low-Rank Adaptation) is a small file that changes how an existing image model behaves, for example to add a style, a character, an object or faster generation, without replacing the model. It stores its changes as pairs of thin matrices, which ComfyUI adds to the model's weights when it loads the LoRA. The original model file is never modified.

Where do LoRA files go in ComfyUI?

In ComfyUI/models/loras. In ComfyUI Desktop on Windows that's %LOCALAPPDATA%\Comfy-Desktop\ComfyUI-Shared\models\loras. Press R in ComfyUI after adding a file and it appears in the Load LoRA node's list without a restart.

What strength should I use for a LoRA?

Start with the strength recommended on the LoRA's download page. Most style and character LoRAs work somewhere between 0.6 and 1.0, but some are made for far lower values: ByteDance recommends 0.125 for its Hyper-FLUX LoRAs, which turn an image into noise at 1.0. With no recommendation, fix the seed and compare 0.6, 0.8 and 1.0.

What do LoRA rank and alpha mean?

Rank is the width of the two thin strips a LoRA stores for each layer it changes. A higher rank can hold more detail and makes a bigger file. Alpha is an optional scaling value saved in the file: when it's there, ComfyUI multiplies the change by alpha divided by rank, on top of the strength you set. The LoRA in this guide is rank 64 and has no alpha, so its strength applies directly.

Can I use an SDXL LoRA with FLUX?

No. A LoRA only works with the model family it was trained for, because its changes are matched to that model's layers by name and shape. Loading an SDXL LoRA on FLUX makes ComfyUI print "lora key not loaded" warnings in the console and the LoRA has no useful effect. Look for a version trained for your model.

What is the difference between Load LoRA and Load LoRA (Model and CLIP)?

Load LoRA (LoraLoaderModelOnly) applies a LoRA to the diffusion model only. Load LoRA (Model and CLIP) applies it to the diffusion model and to the text encoder, with a separate strength for each. Use the model-only node for most FLUX, Qwen-Image and WAN LoRAs, and the Model and CLIP node for LoRAs trained with text-encoder changes, which is common with SD 1.5 and SDXL.

How many LoRAs can I use at once?

There's no fixed limit: chain as many Load LoRA nodes on the model wire as you like. In practice two or three is where results stay predictable. Each LoRA's changes add up on the same weights, so lower the strength of each when combining them, and avoid stacking LoRAs that pull in different directions, such as two styles.

Does a LoRA make generation slower?

Not noticeably. ComfyUI applies the LoRA's changes to the model's weights as it loads them, so the cost is a few seconds when the LoRA is first applied rather than a slowdown on every step. In the tests for this guide, 16-step FLUX renders took eight to nine seconds on an RTX 4090 with or without the LoRA.