Skip to content

Commit

Permalink
Fix issue with TE LR
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Mar 3, 2024
1 parent 2d36740 commit a426023
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 9 deletions.
24 changes: 15 additions & 9 deletions kohya_gui/common_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,17 +781,23 @@ def run_cmd_advanced_training(**kwargs):
if learning_rate:
run_cmd += f' --learning_rate="{learning_rate}"'

learning_rate_te = kwargs.get("learning_rate_te")
if learning_rate_te:
run_cmd += f' --learning_rate_te="{learning_rate_te}"'
if "learning_rate_te" in kwargs:
if kwargs["learning_rate_te"] == 0:
run_cmd += f' --learning_rate_te="0"'
else:
run_cmd += f' --learning_rate_te="{kwargs["learning_rate_te"]}"'

learning_rate_te1 = kwargs.get("learning_rate_te1")
if learning_rate_te1:
run_cmd += f' --learning_rate_te1="{learning_rate_te1}"'
if "learning_rate_te1" in kwargs:
if kwargs["learning_rate_te1"] == 0:
run_cmd += f' --learning_rate_te1="0"'
else:
run_cmd += f' --learning_rate_te1="{kwargs["learning_rate_te1"]}"'

learning_rate_te2 = kwargs.get("learning_rate_te2")
if learning_rate_te2:
run_cmd += f' --learning_rate_te2="{learning_rate_te2}"'
if "learning_rate_te2" in kwargs:
if kwargs["learning_rate_te2"] == 0:
run_cmd += f' --learning_rate_te2="0"'
else:
run_cmd += f' --learning_rate_te2="{kwargs["learning_rate_te2"]}"'

logging_dir = kwargs.get("logging_dir")
if logging_dir:
Expand Down
91 changes: 91 additions & 0 deletions test/config/dreambooth-Prodigy-SDXL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"adaptive_noise_scale": 0,
"additional_parameters": "",
"bucket_no_upscale": true,
"bucket_reso_steps": 1,
"cache_latents": true,
"cache_latents_to_disk": false,
"caption_dropout_every_n_epochs": 0.0,
"caption_dropout_rate": 0,
"caption_extension": "",
"clip_skip": 2,
"color_aug": false,
"enable_bucket": true,
"epoch": 1,
"flip_aug": false,
"full_bf16": false,
"full_fp16": false,
"gpu_ids": "",
"gradient_accumulation_steps": 1,
"gradient_checkpointing": false,
"keep_tokens": "0",
"learning_rate": 1.0,
"learning_rate_te": 1e-05,
"learning_rate_te1": 1e-05,
"learning_rate_te2": 0.0,
"logging_dir": "./test/logs",
"lr_scheduler": "cosine",
"lr_scheduler_args": "",
"lr_scheduler_num_cycles": "",
"lr_scheduler_power": "",
"lr_warmup": 0,
"max_bucket_reso": 2048,
"max_data_loader_n_workers": "0",
"max_resolution": "512,512",
"max_timestep": 1000,
"max_token_length": "75",
"max_train_epochs": "",
"max_train_steps": "",
"mem_eff_attn": false,
"min_bucket_reso": 256,
"min_snr_gamma": 0,
"min_timestep": 0,
"mixed_precision": "bf16",
"model_list": "stabilityai/stable-diffusion-xl-base-1.0",
"multi_gpu": false,
"multires_noise_discount": 0.2,
"multires_noise_iterations": 8,
"no_token_padding": false,
"noise_offset": "0.05",
"noise_offset_type": "Multires",
"num_cpu_threads_per_process": 2,
"num_machines": 1,
"num_processes": 1,
"optimizer": "Prodigy",
"optimizer_args": "decouple=True weight_decay=0.6 betas=0.9,0.99 use_bias_correction=True",
"output_dir": "./test/output",
"output_name": "db-Prodigy",
"persistent_data_loader_workers": false,
"pretrained_model_name_or_path": "stabilityai/stable-diffusion-xl-base-1.0",
"prior_loss_weight": 1.0,
"random_crop": false,
"reg_data_dir": "",
"resume": "",
"sample_every_n_epochs": 0,
"sample_every_n_steps": 25,
"sample_prompts": "a painting of a gas mask , by darius kawasaki",
"sample_sampler": "euler_a",
"save_every_n_epochs": 1,
"save_every_n_steps": 0,
"save_last_n_steps": 0,
"save_last_n_steps_state": 0,
"save_model_as": "safetensors",
"save_precision": "fp16",
"save_state": false,
"scale_v_pred_loss_like_noise_pred": false,
"sdxl": true,
"seed": "1234",
"shuffle_caption": false,
"stop_text_encoder_training": 0,
"train_batch_size": 1,
"train_data_dir": "./test/img",
"use_wandb": false,
"v2": false,
"v_parameterization": false,
"v_pred_like_loss": 0,
"vae": "",
"vae_batch_size": 0,
"wandb_api_key": "",
"weighted_captions": false,
"xformers": "xformers"
}

1 comment on commit a426023

@bmaltais
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.