Skip to content

Commit

Permalink
Merge pull request kohya-ss#1620 from Akegarasu/sd3
Browse files Browse the repository at this point in the history
fix: backward compatibility for text_encoder_lr
  • Loading branch information
kohya-ss authored Sep 20, 2024
2 parents b844c70 + 0535cd2 commit 24f8975
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,11 @@ def train(self, args):
if support_multiple_lrs:
text_encoder_lr = args.text_encoder_lr
else:
text_encoder_lr = None if args.text_encoder_lr is None or len(args.text_encoder_lr) == 0 else args.text_encoder_lr[0]
# toml backward compatibility
if args.text_encoder_lr is None or isinstance(args.text_encoder_lr, float):
text_encoder_lr = args.text_encoder_lr
else:
text_encoder_lr = None if len(args.text_encoder_lr) == 0 else args.text_encoder_lr[0]
try:
if support_multiple_lrs:
results = network.prepare_optimizer_params_with_multiple_te_lrs(text_encoder_lr, args.unet_lr, args.learning_rate)
Expand Down

0 comments on commit 24f8975

Please sign in to comment.