Skip to content

Commit

Permalink
Fix issue with kohya locon not training the convolution layers
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Mar 13, 2023
1 parent 1e6f2b2 commit 91e19ca
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ This will store your a backup file with your current locally installed pip packa

## Change History

* 2023.03/12 (v21.2.3):
* 2023/03/12 (v21.2.4):
- Fix issue with kohya locon not training the convolution layers
- Update LyCORIS module version
- Update LyCORYS locon extract tool
* 2023/03/12 (v21.2.3):
- Add validation that all requirements are met before starting the GUI.
* 2023/03/11 (v21.2.2):
- Add support for LoRA LoHa type. See https://github.com/KohakuBlueleaf/LyCORIS for more details.
Expand Down
2 changes: 1 addition & 1 deletion lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def train_model(
if LoRA_type == 'Kohya LoCon':
run_cmd += f' --network_module=networks.lora'
run_cmd += (
f' --network_args "conv_lora_dim={conv_dim}" "conv_alpha={conv_alpha}"'
f' --network_args "conv_dim={conv_dim}" "conv_alpha={conv_alpha}"'
)
if LoRA_type == 'Standard':
run_cmd += f' --network_module=networks.lora'
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ timm==0.6.12
huggingface-hub==0.12.0
tensorflow==2.10.1
# For locon support
lycoris_lora==0.0.9
lycoris_lora==0.1.2
# for kohya_ss library
.
16 changes: 15 additions & 1 deletion tools/lycoris_locon_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ def get_args():
"--conv_quantile", help="singular value quantile for conv layer quantile mode",
default=1., type=float
)
parser.add_argument(
"--use_sparse_bias", help="enable sparse bias",
default=False, action="store_true"
)
parser.add_argument(
"--sparsity", help="sparsity for sparse bias",
default=0.98, type=float
)
parser.add_argument(
"--disable_cp", help="don't use cp decomposition",
default=False, action="store_true"
)
return parser.parse_args()
ARGS = get_args()

Expand Down Expand Up @@ -102,7 +114,9 @@ def main():
base, db,
args.mode,
linear_mode_param, conv_mode_param,
args.device
args.device,
args.use_sparse_bias, args.sparsity,
# not args.disable_small_conv
)

if args.safetensors:
Expand Down

0 comments on commit 91e19ca

Please sign in to comment.