Skip to content

Commit

Permalink
fix text_encoder_lr to work with int closes #1608
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss committed Sep 17, 2024
1 parent d8d15f1 commit 0cbe95b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions networks/lora_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,8 @@ def prepare_optimizer_params_with_multiple_te_lrs(self, text_encoder_lr, unet_lr
# if float, use the same value for both text encoders
if text_encoder_lr is None or (isinstance(text_encoder_lr, list) and len(text_encoder_lr) == 0):
text_encoder_lr = [default_lr, default_lr]
elif isinstance(text_encoder_lr, float):
text_encoder_lr = [text_encoder_lr, text_encoder_lr]
elif isinstance(text_encoder_lr, float) or isinstance(text_encoder_lr, int):
text_encoder_lr = [float(text_encoder_lr), float(text_encoder_lr)]
elif len(text_encoder_lr) == 1:
text_encoder_lr = [text_encoder_lr[0], text_encoder_lr[0]]

Expand Down

0 comments on commit 0cbe95b

Please sign in to comment.