Update GUI and Readme

This commit is contained in:
bmaltais 2022-12-22 13:14:46 -05:00
parent f60c8addd5
commit 8a99af9269
8 changed files with 79 additions and 69 deletions

View File

@ -71,7 +71,7 @@ When a new release comes out you can upgrade your repo with the following comman
.\upgrade.bat .\upgrade.bat
``` ```
or you can do it manually with alternatively you can do it manually with
```powershell ```powershell
cd kohya_ss cd kohya_ss
@ -84,15 +84,27 @@ Once the commands have completed successfully you should be ready to use the new
## GUI ## GUI
There is now support for GUI based training using gradio. You can start the GUI interface by running: There is now support for GUI based training using gradio. You can start the complete kohya training GUI interface by running:
```powershell ```powershell
.\dreambooth.bat .\kohya.cmd
```
and select the Dreambooth tab.
Alternativelly you can use the Dreambooth focus GUI with
```powershell
.\dreambooth.cmd
``` ```
## CLI ## CLI
You can find various examples of how to leverage the fine_tune.py in this folder: https://github.com/bmaltais/kohya_ss/tree/master/examples You can find various examples of how to leverage the `train_db.py` in this folder: https://github.com/bmaltais/kohya_ss/tree/master/examples
## Support
Drop by the discord server for support: https://discord.com/channels/1041518562487058594/1041518563242020906
## Quickstart screencast ## Quickstart screencast

View File

@ -107,15 +107,23 @@ You can also use the `Captioning` tool found under the `Utilities` tab in the GU
## GUI ## GUI
Support for GUI based training using gradio. You can start the GUI interface by running: There is now support for GUI based training using gradio. You can start the complete kohya training GUI interface by running:
```powershell ```powershell
.\finetune.bat .\kohya.cmd
```
and select the Finetune tab.
Alternativelly you can use the Finetune focus GUI with
```powershell
.\finetune.cmd
``` ```
## CLI ## CLI
You can find various examples of how to leverage the fine_tune.py in this folder: https://github.com/bmaltais/kohya_ss/tree/master/examples You can find various examples of how to leverage the `fine_tune.py` in this folder: https://github.com/bmaltais/kohya_ss/tree/master/examples
## Support ## Support

View File

@ -509,7 +509,7 @@ def dreambooth_tab(
): ):
dummy_db_true = gr.Label(value=True, visible=False) dummy_db_true = gr.Label(value=True, visible=False)
dummy_db_false = gr.Label(value=False, visible=False) dummy_db_false = gr.Label(value=False, visible=False)
gr.Markdown('Enter kohya finetuner parameter using this interface.') gr.Markdown('Enter kohya dreambooth training parameter using this interface.')
with gr.Accordion('Configuration file', open=False): with gr.Accordion('Configuration file', open=False):
with gr.Row(): with gr.Row():
button_open_config = gr.Button('Open 📂', elem_id='open_folder') button_open_config = gr.Button('Open 📂', elem_id='open_folder')

View File

@ -44,7 +44,6 @@ def save_configuration(
train_text_encoder, train_text_encoder,
create_buckets, create_buckets,
create_caption, create_caption,
train,
save_model_as, save_model_as,
caption_extension, caption_extension,
): ):
@ -89,7 +88,6 @@ def save_configuration(
'train_text_encoder': train_text_encoder, 'train_text_encoder': train_text_encoder,
'create_buckets': create_buckets, 'create_buckets': create_buckets,
'create_caption': create_caption, 'create_caption': create_caption,
'train': train,
'save_model_as': save_model_as, 'save_model_as': save_model_as,
'caption_extension': caption_extension, 'caption_extension': caption_extension,
} }
@ -125,7 +123,6 @@ def open_config_file(
train_text_encoder, train_text_encoder,
create_buckets, create_buckets,
create_caption, create_caption,
train,
save_model_as, save_model_as,
caption_extension, caption_extension,
): ):
@ -170,7 +167,6 @@ def open_config_file(
my_data.get('train_text_encoder', train_text_encoder), my_data.get('train_text_encoder', train_text_encoder),
my_data.get('create_buckets', create_buckets), my_data.get('create_buckets', create_buckets),
my_data.get('create_caption', create_caption), my_data.get('create_caption', create_caption),
my_data.get('train', train),
my_data.get('save_model_as', save_model_as), my_data.get('save_model_as', save_model_as),
my_data.get('caption_extension', caption_extension), my_data.get('caption_extension', caption_extension),
) )
@ -179,7 +175,6 @@ def open_config_file(
def train_model( def train_model(
generate_caption_database, generate_caption_database,
generate_image_buckets, generate_image_buckets,
train,
pretrained_model_name_or_path, pretrained_model_name_or_path,
v2, v2,
v_parameterization, v_parameterization,
@ -262,7 +257,6 @@ def train_model(
# Run the command # Run the command
subprocess.run(command) subprocess.run(command)
if train:
image_num = len( image_num = len(
[f for f in os.listdir(image_folder) if f.endswith('.npz')] [f for f in os.listdir(image_folder) if f.endswith('.npz')]
) )
@ -409,7 +403,7 @@ def finetune_tab():
dummy_ft_true = gr.Label(value=True, visible=False) dummy_ft_true = gr.Label(value=True, visible=False)
dummy_ft_false = gr.Label(value=False, visible=False) dummy_ft_false = gr.Label(value=False, visible=False)
gr.Markdown( gr.Markdown(
'Enter kohya finetuner parameter using this interface.' 'Enter kohya finetune training parameter using this interface.'
) )
with gr.Accordion('Configuration File Load/Save', open=False): with gr.Accordion('Configuration File Load/Save', open=False):
with gr.Row(): with gr.Row():
@ -632,16 +626,14 @@ def finetune_tab():
create_buckets = gr.Checkbox( create_buckets = gr.Checkbox(
label='Generate image buckets', value=True label='Generate image buckets', value=True
) )
train = gr.Checkbox(label='Train model', value=True)
button_run = gr.Button('Run') button_run = gr.Button('Train model')
button_run.click( button_run.click(
train_model, train_model,
inputs=[ inputs=[
create_caption, create_caption,
create_buckets, create_buckets,
train,
pretrained_model_name_or_path_input, pretrained_model_name_or_path_input,
v2_input, v2_input,
v_parameterization_input, v_parameterization_input,
@ -693,7 +685,6 @@ def finetune_tab():
train_text_encoder_input, train_text_encoder_input,
create_buckets, create_buckets,
create_caption, create_caption,
train,
save_model_as_dropdown, save_model_as_dropdown,
caption_extention_input, caption_extention_input,
], ],
@ -721,7 +712,6 @@ def finetune_tab():
train_text_encoder_input, train_text_encoder_input,
create_buckets, create_buckets,
create_caption, create_caption,
train,
save_model_as_dropdown, save_model_as_dropdown,
caption_extention_input, caption_extention_input,
], ],
@ -754,7 +744,6 @@ def finetune_tab():
train_text_encoder_input, train_text_encoder_input,
create_buckets, create_buckets,
create_caption, create_caption,
train,
save_model_as_dropdown, save_model_as_dropdown,
caption_extention_input, caption_extention_input,
], ],
@ -788,7 +777,6 @@ def finetune_tab():
train_text_encoder_input, train_text_encoder_input,
create_buckets, create_buckets,
create_caption, create_caption,
train,
save_model_as_dropdown, save_model_as_dropdown,
caption_extention_input, caption_extention_input,
], ],

1
kohya.cmd Normal file
View File

@ -0,0 +1 @@
.\venv\Scripts\python.exe .\kohya_gui.py

1
utilities.cmd Normal file
View File

@ -0,0 +1 @@
.\venv\Scripts\python.exe library\utilities.py