Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with kohya locon not training the convolution layers #366

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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