Skip to content

Commit

Permalink
Merge pull request #1835 from aplio/bugfix/stop-using-sdxl-params-whe…
Browse files Browse the repository at this point in the history
…n-not-sdxl

bugfix. check is_sdxl before adding sdxl params.
  • Loading branch information
bmaltais authored Jan 3, 2024
2 parents bc0a7bf + 2ed5339 commit cb1d43a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions finetune_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def train_model(
# run_cmd += f' --flip_aug'
if full_path:
run_cmd += f' --full_path'
if sdxl_no_half_vae:
if sdxl_checkbox and sdxl_no_half_vae:
log.info(
'Using mixed_precision = no because no half vae is selected...'
)
Expand Down Expand Up @@ -584,11 +584,12 @@ def train_model(
if int(max_token_length) > 75:
run_cmd += f' --max_token_length={max_token_length}'

if sdxl_cache_text_encoder_outputs:
run_cmd += f' --cache_text_encoder_outputs'
if sdxl_checkbox:
if sdxl_cache_text_encoder_outputs:
run_cmd += f' --cache_text_encoder_outputs'

if sdxl_no_half_vae:
run_cmd += f' --no_half_vae'
if sdxl_no_half_vae:
run_cmd += f' --no_half_vae'

run_cmd += run_cmd_training(
learning_rate=learning_rate,
Expand Down
9 changes: 5 additions & 4 deletions lora_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,11 +974,12 @@ def train_model(
if network_dropout > 0.0:
run_cmd += f' --network_dropout="{network_dropout}"'

if sdxl_cache_text_encoder_outputs:
run_cmd += f" --cache_text_encoder_outputs"
if sdxl:
if sdxl_cache_text_encoder_outputs:
run_cmd += f" --cache_text_encoder_outputs"

if sdxl_no_half_vae:
run_cmd += f" --no_half_vae"
if sdxl_no_half_vae:
run_cmd += f" --no_half_vae"

if full_bf16:
run_cmd += f" --full_bf16"
Expand Down
2 changes: 1 addition & 1 deletion textual_inversion_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def train_model(
if int(gradient_accumulation_steps) > 1:
run_cmd += f' --gradient_accumulation_steps={int(gradient_accumulation_steps)}'

if sdxl_no_half_vae:
if sdxl and sdxl_no_half_vae:
run_cmd += f' --no_half_vae'

run_cmd += run_cmd_training(
Expand Down

0 comments on commit cb1d43a

Please sign in to comment.