[English] [日本語]
This is a utility to apply LoRA Block Weight (lbw) to LoRA for sd1.5 and export to a new safetensors.
Currently only 17 or 26 layers are supported.
※This is a standalone utility, not an extension of StableDiffusion's functionalities.
a1111 webui supported. You can install from "Extensions > Install from URL" tab.
Select "Apply LBW" from Script in txt2img/img2img tab.
- Download the zip file and extract it to a location of your choice.
- Launch PowerShell.
- Execute the following command.
> cd {extract folder}
> python -m venv venv
> venv\Sctipt\activate
> pip install -r requirements.txt
Please launch PowerShell as an administrator and execute the following command
> Set-ExecutionPolicy RemoteSigned
It will ask whether to change the policy, so input [Y].
Please install the libraries listed in requirements.txt
individually.
> pip install numpy
> pip install torch
> pip install safetensors
> python apply_lora_block_weight.py {input} {output} {block weight}
- input file: e:¥foo.safetensor
- output file: e:¥foo_lbw.safetensor (Name is optional)
- BlockWeight: 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1
> python apply_lora_block_weight.py e:¥foo.safetensor e:¥foo_lbw.safetensor 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1
If you want to make the BASE value negative, please insert -- before BlockWeight.
> python apply_lora_block_weight.py e:¥foo.safetensor e:¥foo_lbw.safetensor -- -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
stable-diffusion-webui: AGPL-3.0 license
sd-webui-lora-block-weight: ?
ss-scripts: Apache-2.0 license