kohya-ss / sd-scripts

Apache License 2.0
5.33k stars 881 forks source link

Possible to Separate Learning Rates for Text-Encoder in SDXL LoRA Model Training? #1748

Open Gtonero opened 4 weeks ago

Gtonero commented 4 weeks ago

Is it possible to set the lora [sdxl_train_network.py] text encoder learning rate separately? similar to Flux, In Clip_L there are 4.45 times fewer parameters than Clip_G. As a result, the Text-Encoder adjustment may not match the steps very well.

image

which in SDXL_train.py Instead, there are separate settings.

sdxl_train.py

    parser.add_argument(
        "--learning_rate_te1",
        type=float,
        default=None,
        help="learning rate for text encoder 1 (ViT-L) / text encoder 1 (ViT-L)の学習率",
    )
    parser.add_argument(
        "--learning_rate_te2",
        type=float,
        default=None,
        help="learning rate for text encoder 2 (BiG-G) / text encoder 2 (BiG-G)の学習率",
kohya-ss commented 3 weeks ago

Unfortunately it is not supported for SDXL LoRA. However, FLUX.1/SD3 LoRA already supports it, so I will add it near future.