Home

Awesome

Python License

Composable LoRA/LyCORIS with steps

This extension replaces the built-in LoRA forward procedure and provides support for LoCon and LyCORIS.

This extension is forked from the Composable LoRA extension.

buy me a coffee

stable-diffusion-webui-composable-lycoris

Language

Installation

Note: This version of Composable LoRA already includes all the features of the original version of Composable LoRA. You only need to select one to install.

This extension cannot be used simultaneously with the original version of the Composable LoRA extension. Before installation, you must first delete the stable-diffusion-webui-composable-lora folder of the original version of the Composable LoRA extension in the webui\extensions\ directory.

Next, go to [Extension] -> [Install from URL] in the webui and enter the following URL:

https://github.com/a2569875/stable-diffusion-webui-composable-lora.git

Install and restart to complete the process.

Demo

Here we demonstrate two LoRAs (one LoHA and one LoCon), where

We use the Latent Couple extension for generating the images.

The results are shown below:

It can be observed that:

The highlighting of the prompt words on the image is done using the sd-webui-prompt-highlight plugin.

This test was conducted on May 14, 2023, using Stable Diffusion WebUI version v1.2 (89f9faa).

Another test was conducted on July 25, 2023, using Stable Diffusion WebUI version v1.5.0 (a3ddf46). Using hiyori (princess_connect!) and dia viekone locon model that I trained myself.

Features

Compatible with Composable-Diffusion

By associating LoRA's insertion position in the prompt with AND syntax, LoRA's scope of influence is limited to a specific subprompt.

Composable with step

By placing LoRA within a prompt in the form of [A:B:N], the scope of LoRA's effect is limited to specific drawing steps.

LoRA weight controller

Added a syntax [A #xxx] to control the weight of LoRA at each drawing step.

You can replace the # symbol with \u0023, if # didn't work.

Currently supported options are:

[<lora:A:1> #cmd\(
def my_func\(\)\:
    return sin\(life\)
my_func\(\)
\):10]

All the image:

Eliminate the impact on negative prompts

With the built-in LoRA, negative prompts are always affected by LoRA. This often has a negative impact on the output. So this extension offers options to eliminate the negative effects.

How to use

Enabled

When checked, Composable LoRA is enabled.

Composable LoRA with step

Check this option to enable the feature of turning on or off LoRAs at specific steps.

Use Lora in uc text model encoder

Enable LoRA for uncondition (negative prompt) text model encoder. With this disabled, you can expect better output.

Use Lora in uc diffusion model

Enable LoRA for uncondition (negative prompt) diffusion model (denoiser). With this disabled, you can expect better output.

plot the LoRA weight in all steps

If "Composable LoRA with step" is enabled, you can select this option to generate a chart that shows the relationship between LoRA weight and the number of steps after the drawing is completed. This allows you to observe the variation of LoRA weight at each step.

Other

Compatibilities

--always-batch-cond-uncond must be enabled with --medvram or --lowvram

Changelog

2023-04-02

2023-04-08

2023-04-13

2023-04-19

2023-04-20

2023-04-21

2023-04-22

2023-04-23

2023-04-25

Acknowledgements

<p align="center"><img src="https://count.getloli.com/get/@a2569875-stable-diffusion-webui-composable-lora.github" alt="a2569875/stable-diffusion-webui-composable-lora"></p>