Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Feb 24, 2024
1 parent 768ec88 commit 9564145
Show file tree
Hide file tree
Showing 37 changed files with 95 additions and 31 deletions.
32 changes: 4 additions & 28 deletions SC_finetuning_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def save_configuration(
effnet_checkpoint_path,
previewer_checkpoint_path,
dataset_config_path,
sample_prompts_path,
output_dir,
logging_dir,
flip_aug,
Expand Down Expand Up @@ -183,7 +182,6 @@ def open_configuration(
effnet_checkpoint_path,
previewer_checkpoint_path,
dataset_config_path,
sample_prompts_path,
output_dir,
logging_dir,
flip_aug,
Expand Down Expand Up @@ -313,7 +311,6 @@ def train_model(
effnet_checkpoint_path,
previewer_checkpoint_path,
dataset_config_path,
sample_prompts_path,
output_dir,
logging_dir,
flip_aug,
Expand Down Expand Up @@ -470,7 +467,6 @@ def train_model(
run_cmd += f' --effnet_checkpoint_path "{effnet_checkpoint_path}"'
run_cmd += f' --previewer_checkpoint_path "{previewer_checkpoint_path}"'
run_cmd += f' --dataset_config "{dataset_config_path}"'
# run_cmd += f' --sample_prompts "{sample_prompts_path}"'

run_cmd += run_cmd_advanced_training(
adaptive_noise_scale=adaptive_noise_scale,
Expand Down Expand Up @@ -618,7 +614,7 @@ def sc_finetune_tab(headless=False):
)
effnet_checkpoint_path_file.click(
get_file_path,
inputs=effnet_checkpoint_path,
inputs=[effnet_checkpoint_path, gr.Textbox(value=".safetensors", visible=False, min_width=0)],
outputs=effnet_checkpoint_path,
show_progress=False,
)
Expand All @@ -632,13 +628,13 @@ def sc_finetune_tab(headless=False):
)
previewer_checkpoint_path_file.click(
get_file_path,
inputs=previewer_checkpoint_path,
inputs=[previewer_checkpoint_path, gr.Textbox(value=".safetensors", visible=False, min_width=0)],
outputs=previewer_checkpoint_path,
show_progress=False,
)
with gr.Row():
dataset_config_path = gr.Textbox(
label='Dataset toml path',
label='Dataset toml file path',
placeholder='enter the path to the finetuning dataset toml file',
)
dataset_config_path_file = gr.Button(
Expand All @@ -647,24 +643,10 @@ def sc_finetune_tab(headless=False):
)
dataset_config_path_file.click(
get_file_path,
inputs=dataset_config_path,
inputs=[dataset_config_path, gr.Textbox(value=".toml", visible=False)],
outputs=dataset_config_path,
show_progress=False,
)
sample_prompts_path = gr.Textbox(
label='Sample image prompt path',
placeholder='enter the path to the sample image prompt file',
)
sample_prompts_path_file = gr.Button(
document_symbol,
elem_id='open_folder_small',
)
sample_prompts_path_file.click(
get_file_path,
inputs=sample_prompts_path,
outputs=sample_prompts_path,
show_progress=False,
)
with gr.Row():
logging_dir = gr.Textbox(
label="Logging folder",
Expand Down Expand Up @@ -716,11 +698,6 @@ def sc_finetune_tab(headless=False):
# inputs=[dataset_config_path],
# outputs=[dataset_config_path],
# )
# sample_prompts_path.change(
# remove_doublequote,
# inputs=[sample_prompts_path],
# outputs=[sample_prompts_path],
# )

with gr.Tab("Parameters"):

Expand Down Expand Up @@ -810,7 +787,6 @@ def list_presets(path):
effnet_checkpoint_path,
previewer_checkpoint_path,
dataset_config_path,
sample_prompts_path,
output_dir,
logging_dir,
advanced_training.flip_aug,
Expand Down
83 changes: 83 additions & 0 deletions examples/stable_cascade/preset-13-images-1800steps-test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"adaptive_noise_scale": 0,
"additional_parameters": "--max_grad_norm=0.0 --no_half_vae",
"block_lr": "",
"bucket_no_upscale": false,
"bucket_reso_steps": 64,
"cache_latents": true,
"cache_latents_to_disk": true,
"caption_dropout_every_n_epochs": 0.0,
"caption_dropout_rate": 0,
"caption_extension": "",
"clip_skip": "1",
"color_aug": false,
"dataset_config_path": "D:/kohya_ss/examples/stable_cascade/test_dataset.toml",
"dataset_repeats": "20",
"effnet_checkpoint_path": "E:/models/stable_cascade/effnet_encoder.safetensors",
"epoch": 500,
"flip_aug": false,
"full_bf16": true,
"full_fp16": false,
"gpu_ids": "",
"gradient_accumulation_steps": 1.0,
"gradient_checkpointing": true,
"keep_tokens": "0",
"learning_rate": 1e-05,
"learning_rate_te": 1e-05,
"learning_rate_te1": 1e-05,
"learning_rate_te2": 1e-05,
"logging_dir": "",
"lr_scheduler": "constant",
"lr_scheduler_args": "",
"lr_warmup": 10,
"max_data_loader_n_workers": "0",
"max_timestep": 1000,
"max_token_length": "75",
"max_train_epochs": "60",
"mem_eff_attn": false,
"min_snr_gamma": 0,
"min_timestep": 0,
"mixed_precision": "bf16",
"model_list": "custom",
"multi_gpu": false,
"multires_noise_discount": 0,
"multires_noise_iterations": 0,
"noise_offset": 0,
"noise_offset_type": "Original",
"num_cpu_threads_per_process": 4,
"num_machines": 1,
"num_processes": 1,
"optimizer": "Adafactor",
"optimizer_args": "scale_parameter=False relative_step=False warmup_init=False weight_decay=0.01",
"output_dir": "E:/model/test",
"output_name": "ted-test-no-te",
"persistent_data_loader_workers": false,
"pretrained_model_name_or_path": "E:/models/stable_cascade/stage_c_bf16.safetensors",
"previewer_checkpoint_path": "E:/models/stable_cascade/previewer.safetensors",
"random_crop": false,
"resume": "",
"sample_every_n_epochs": 0,
"sample_every_n_steps": 100,
"sample_prompts": "a zxc on the surface of the moon holding an orange. --w 1024 --h 1024 --l 4 --s 30",
"sample_prompts_path": "D:/kohya_ss/examples/stable_cascade/prompt.txt",
"sample_sampler": "dpm_2",
"save_every_n_epochs": 0,
"save_every_n_steps": 100,
"save_last_n_steps": 0,
"save_last_n_steps_state": 0,
"save_model_as": "safetensors",
"save_precision": "bf16",
"save_state": false,
"scale_v_pred_loss_like_noise_pred": false,
"seed": "",
"shuffle_caption": false,
"train_batch_size": 3,
"train_text_encoder": true,
"use_wandb": false,
"v2": false,
"v_parameterization": false,
"v_pred_like_loss": 0,
"vae_batch_size": 0,
"wandb_api_key": "",
"xformers": "none"
}
Binary file added examples/stable_cascade/test_dataset/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zxc looking to the left
Binary file added examples/stable_cascade/test_dataset/10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a photo of zxc
Binary file added examples/stable_cascade/test_dataset/11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zxc writing on a piece of paper
File renamed without changes.
Binary file added examples/stable_cascade/test_dataset/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zxc sitting on a couch
Binary file added examples/stable_cascade/test_dataset/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zxc standing
Binary file added examples/stable_cascade/test_dataset/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zxc standing rear view

This file was deleted.

Binary file not shown.
Binary file added examples/stable_cascade/test_dataset/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zxc sitting
Binary file added examples/stable_cascade/test_dataset/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file added examples/stable_cascade/test_dataset/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Binary file not shown.
Binary file added examples/stable_cascade/test_dataset/8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/stable_cascade/test_dataset/8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zxc standing amongst sausages
Binary file added examples/stable_cascade/test_dataset/9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.

This file was deleted.

Binary file not shown.
Binary file removed examples/stable_cascade/test_dataset/Ted-Movie.webp
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

0 comments on commit 9564145

Please sign in to comment.