LoRA(Low-Rank Adaptation) models are small Stable Diffusion models that apply tiny changes to standard checkpoint models. They are usually 10 to 100 times smaller than checkpoint models. That makes them very attractive to people having an extensive collection of models.
It offers a good trade-off between file size and training power. For example, Dreambooth is powerful but results in large model files (2-7 GBs). Textual inversions are tiny (about 100 KBs), but you can't do as much.
LoRA sits in between: Their files sizes are manageable (2-200 MBs), and the training power is decent.
LoRA is an excellent solution to the storage problem. Like textual inversion, you cannot use a LoRA model alone. It must be used with a model checkpoint file. LoRA modifiles styles by applying small changes to the accompanying model file.
LoRA applies small changes to the most critical part of Stable Diffusion models:
It is the part of the model where the image and the prompt meet. According to the pager, it sufficient to fine-tune this part of the model to achieve good training. The cross-attention layers are the yellow parts in the Stable Diffusion architecture below.
LORA fine-tunes the cross-attention layers (the QKV parts of the U-Net noise predictor). (Figure from Stable Diffusion paper.)
The weights of a cross-attention layer are arranged in matrices. A LoRA model fine-tunes a model by adding its weights to these matrices.
<lora:filename:multiplier>
It is the file name of the LoRA model, excluding the extension (.pt, .bin.etc)
It is the weight applied to the LoRA model. The defaults is 1. Setting it to 0 disables the model.
Here we can use the model button
Source: Stable Diffusion Art
Click on the Lora tab. You should see a list of LoRA models installed. Click on the one you want to use. And the LoRA phrase will be inserted in the prompt.
Source: Stable Diffusion Art
You may adjust the multiplier to crank up or tune down the effect. Setting the multiplier 0 disables the LoRA model. You can adjust the style effect between 0 and 1.
Some LoRA models are trained with Dreambooth. You will need to include a trigger keyword to use the LoRA model. You can find the trigger keyword on the model’s page.
Similar to embeddings, you can use multiple LoRA models at the same time. You can also use them with embeddings.
In AUTOMATIC1111, the LoRA phrase is not part of the prompt. It will be removed after the LoRA model is applied. That means you cannot use prompt syntax like [keyword1:keyword2: 0.8] with them.
{% embed url="https://stable-diffusion-art.com/lora/" %}