Fix issue with kohya locon not training the convolution layers

This commit is contained in:
bmaltais 2023-03-12 20:36:58 -04:00
parent 1e6f2b2d4e
commit 91e19ca9d9
4 changed files with 22 additions and 4 deletions

View File

@ -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.

View File

@ -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'

View File

@ -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
.

View File

@ -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()
@ -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: