diff --git a/dreambooth_gui.py b/dreambooth_gui.py index 337ced1..ff38a5f 100644 --- a/dreambooth_gui.py +++ b/dreambooth_gui.py @@ -152,12 +152,8 @@ def save_configuration( # Return the values of the variables as a dictionary variables = { name: value - for name, value in parameters # locals().items() - if name - not in [ - 'file_path', - 'save_as', - ] + for name, value in sorted(parameters, key=lambda x: x[0]) + if name not in ['file_path', 'save_as'] } # Extract the destination directory from the file path @@ -517,7 +513,7 @@ def train_model( run_cmd += f' --train_data_dir="{train_data_dir}"' if len(reg_data_dir): run_cmd += f' --reg_data_dir="{reg_data_dir}"' - run_cmd += f' --resolution={max_resolution}' + run_cmd += f' --resolution="{max_resolution}"' run_cmd += f' --output_dir="{output_dir}"' if not logging_dir == '': run_cmd += f' --logging_dir="{logging_dir}"' diff --git a/finetune_gui.py b/finetune_gui.py index 8cfa0ef..c4d8732 100644 --- a/finetune_gui.py +++ b/finetune_gui.py @@ -151,12 +151,8 @@ def save_configuration( # Return the values of the variables as a dictionary variables = { name: value - for name, value in parameters # locals().items() - if name - not in [ - 'file_path', - 'save_as', - ] + for name, value in sorted(parameters, key=lambda x: x[0]) + if name not in ['file_path', 'save_as'] } # Extract the destination directory from the file path @@ -501,7 +497,7 @@ def train_model( run_cmd += f' --learning_rate={learning_rate}' run_cmd += ' --enable_bucket' - run_cmd += f' --resolution={max_resolution}' + run_cmd += f' --resolution="{max_resolution}"' run_cmd += f' --min_bucket_reso={min_bucket_reso}' run_cmd += f' --max_bucket_reso={max_bucket_reso}' diff --git a/library/common_gui.py b/library/common_gui.py index cd70994..66887ea 100644 --- a/library/common_gui.py +++ b/library/common_gui.py @@ -1002,8 +1002,8 @@ def gradio_advanced_training(headless=False): bucket_no_upscale = gr.Checkbox( label="Don't upscale bucket resolution", value=True ) - bucket_reso_steps = gr.Number( - label='Bucket resolution steps', value=64 + bucket_reso_steps = gr.Slider( + label='Bucket resolution steps', value=64, minimum=1, maximum=128 ) random_crop = gr.Checkbox( label='Random crop instead of center crop', value=False diff --git a/lora_gui.py b/lora_gui.py index 255d419..db874e7 100644 --- a/lora_gui.py +++ b/lora_gui.py @@ -190,12 +190,8 @@ def save_configuration( # Return the values of the variables as a dictionary variables = { name: value - for name, value in parameters # locals().items() - if name - not in [ - 'file_path', - 'save_as', - ] + for name, value in sorted(parameters, key=lambda x: x[0]) + if name not in ['file_path', 'save_as'] } # Extract the destination directory from the file path @@ -652,7 +648,7 @@ def train_model( run_cmd += f' --train_data_dir="{train_data_dir}"' if len(reg_data_dir): run_cmd += f' --reg_data_dir="{reg_data_dir}"' - run_cmd += f' --resolution={max_resolution}' + run_cmd += f' --resolution="{max_resolution}"' run_cmd += f' --output_dir="{output_dir}"' if not logging_dir == '': run_cmd += f' --logging_dir="{logging_dir}"' diff --git a/textual_inversion_gui.py b/textual_inversion_gui.py index f7581d8..7c9580c 100644 --- a/textual_inversion_gui.py +++ b/textual_inversion_gui.py @@ -157,12 +157,8 @@ def save_configuration( # Return the values of the variables as a dictionary variables = { name: value - for name, value in parameters # locals().items() - if name - not in [ - 'file_path', - 'save_as', - ] + for name, value in sorted(parameters, key=lambda x: x[0]) + if name not in ['file_path', 'save_as'] } # Extract the destination directory from the file path @@ -530,7 +526,7 @@ def train_model( run_cmd += f' --train_data_dir="{train_data_dir}"' if len(reg_data_dir): run_cmd += f' --reg_data_dir="{reg_data_dir}"' - run_cmd += f' --resolution={max_resolution}' + run_cmd += f' --resolution="{max_resolution}"' run_cmd += f' --output_dir="{output_dir}"' if not logging_dir == '': run_cmd += f' --logging_dir="{logging_dir}"'