From 2ed5339bd2ddf01c1a20765fcd038a85759b1a7d Mon Sep 17 00:00:00 2001 From: aplio Date: Wed, 3 Jan 2024 17:18:21 +0900 Subject: [PATCH] bugfix. check is_sdxl before adding sdxl params. https://github.com/bmaltais/kohya_ss/issues/1246 --- finetune_gui.py | 11 ++++++----- lora_gui.py | 9 +++++---- textual_inversion_gui.py | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/finetune_gui.py b/finetune_gui.py index c18355a06..7a9e77cd3 100644 --- a/finetune_gui.py +++ b/finetune_gui.py @@ -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...' ) @@ -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, diff --git a/lora_gui.py b/lora_gui.py index fcfc3303a..63fe4398e 100644 --- a/lora_gui.py +++ b/lora_gui.py @@ -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" diff --git a/textual_inversion_gui.py b/textual_inversion_gui.py index 1b68f9a35..7e9d7c7b9 100644 --- a/textual_inversion_gui.py +++ b/textual_inversion_gui.py @@ -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(