Skip to content

Commit aaf0396

Browse files
committed
Fix vae path validation
1 parent c31e6c1 commit aaf0396

File tree

5 files changed

+19
-48
lines changed

5 files changed

+19
-48
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ dataset/**
5050
!dataset/**/.gitkeep
5151
models
5252
data
53-
config.toml
53+
config.toml
54+
sd-scripts

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,13 @@ The documentation in this section will be moved to a separate document later.
382382

383383
## Change History
384384

385-
### 2024/03/20 (v23.0.15)
385+
### 2024/03/21 (v23.0.15)
386386

387387
- Add support for toml dataset configuration fole to all trainers
388388
- Add new setup menu option to install Triton 2.1.0 for Windows
389389
- Add support for LyCORIS BOFT and DoRA and QLyCORIS options for LoHA, LoKr and LoCon
390+
- Fix issue with vae path validation
391+
- Other fixes
390392

391393
### 2024/03/19 (v23.0.14)
392394

kohya_gui/class_advanced_training.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def __init__(
3939
headless (bool): Run in headless mode without GUI.
4040
finetuning (bool): Enable model fine-tuning.
4141
training_type (str): The type of training to be performed.
42-
default_vae_dir (str): Default directory for VAE models.
43-
default_output_dir (str): Default directory for output files.
42+
config (dict): Configuration options for the training process.
4443
"""
4544
self.headless = headless
4645
self.finetuning = finetuning
@@ -369,10 +368,6 @@ def list_state_dirs(path):
369368
outputs=self.resume,
370369
show_progress=False,
371370
)
372-
# self.max_train_epochs = gr.Textbox(
373-
# label='Max train epoch',
374-
# placeholder='(Optional) Override number of epoch',
375-
# )
376371
self.max_data_loader_n_workers = gr.Textbox(
377372
label="Max num workers for DataLoader",
378373
placeholder="(Optional) Override number of epoch. Default: 8",

kohya_gui/common_gui.py

+7
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,13 @@ def validate_path(
17751775
if key in ["output_dir", "logging_dir"]:
17761776
if not validate_path(value, key, create_if_missing=True):
17771777
return False
1778+
elif key in ["vae"]:
1779+
# Check if it matches the Hugging Face model pattern
1780+
if re.match(r"^[\w-]+\/[\w-]+$", value):
1781+
log.info("Checking vae... huggingface.co model, skipping validation")
1782+
else:
1783+
if not validate_path(value, key):
1784+
return False
17781785
else:
17791786
if key not in ["pretrained_model_name_or_path"]:
17801787
if not validate_path(value, key):

test/config/dreambooth-AdamW8bit.json

+6-40
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"LoRA_type": "Standard",
3-
"LyCORIS_preset": "full",
42
"adaptive_noise_scale": 0,
53
"additional_parameters": "",
6-
"block_alphas": "",
7-
"block_dims": "",
8-
"block_lr_zero_threshold": "",
94
"bucket_no_upscale": true,
105
"bucket_reso_steps": 64,
116
"cache_latents": true,
@@ -15,58 +10,45 @@
1510
"caption_extension": "",
1611
"clip_skip": 2,
1712
"color_aug": false,
18-
"constrain": 0.0,
19-
"conv_alpha": 1,
20-
"conv_block_alphas": "",
21-
"conv_block_dims": "",
22-
"conv_dim": 1,
23-
"debiased_estimation_loss": false,
24-
"decompose_both": false,
25-
"dim_from_weights": false,
26-
"down_lr_weight": "",
13+
"dataset_config": "",
2714
"enable_bucket": true,
2815
"epoch": 1,
29-
"factor": -1,
3016
"flip_aug": false,
31-
"fp8_base": false,
3217
"full_bf16": false,
3318
"full_fp16": false,
3419
"gpu_ids": "",
3520
"gradient_accumulation_steps": 1,
3621
"gradient_checkpointing": false,
3722
"keep_tokens": "0",
3823
"learning_rate": 5e-05,
24+
"learning_rate_te": 1e-05,
25+
"learning_rate_te1": 1e-05,
26+
"learning_rate_te2": 1e-05,
3927
"log_tracker_config": "",
4028
"log_tracker_name": "",
4129
"logging_dir": "./test/logs",
42-
"lora_network_weights": "",
4330
"lr_scheduler": "constant",
4431
"lr_scheduler_args": "",
4532
"lr_scheduler_num_cycles": "",
4633
"lr_scheduler_power": "",
4734
"lr_warmup": 0,
4835
"max_bucket_reso": 2048,
4936
"max_data_loader_n_workers": "0",
50-
"max_grad_norm": 1,
5137
"max_resolution": "512,512",
5238
"max_timestep": 1000,
5339
"max_token_length": "75",
5440
"max_train_epochs": "",
5541
"max_train_steps": "",
5642
"mem_eff_attn": false,
57-
"mid_lr_weight": "",
5843
"min_bucket_reso": 256,
5944
"min_snr_gamma": 0,
6045
"min_timestep": 0,
6146
"mixed_precision": "bf16",
6247
"model_list": "runwayml/stable-diffusion-v1-5",
63-
"module_dropout": 0,
6448
"multi_gpu": false,
6549
"multires_noise_discount": 0,
6650
"multires_noise_iterations": 0,
67-
"network_alpha": 1,
68-
"network_dim": 8,
69-
"network_dropout": 0,
51+
"no_token_padding": false,
7052
"noise_offset": 0.05,
7153
"noise_offset_type": "Original",
7254
"num_cpu_threads_per_process": 2,
@@ -80,10 +62,7 @@
8062
"pretrained_model_name_or_path": "runwayml/stable-diffusion-v1-5",
8163
"prior_loss_weight": 1.0,
8264
"random_crop": false,
83-
"rank_dropout": 0,
84-
"rank_dropout_scale": false,
8565
"reg_data_dir": "",
86-
"rescaled": false,
8766
"resume": "",
8867
"sample_every_n_epochs": 0,
8968
"sample_every_n_steps": 25,
@@ -97,30 +76,17 @@
9776
"save_precision": "fp16",
9877
"save_state": false,
9978
"scale_v_pred_loss_like_noise_pred": false,
100-
"scale_weight_norms": 0,
10179
"sdxl": false,
102-
"sdxl_cache_text_encoder_outputs": false,
103-
"sdxl_no_half_vae": true,
10480
"seed": "1234",
10581
"shuffle_caption": false,
10682
"stop_text_encoder_training": 0,
107-
"text_encoder_lr": 0.0,
10883
"train_batch_size": 4,
10984
"train_data_dir": "./test/img",
110-
"train_norm": false,
111-
"train_on_input": true,
112-
"training_comment": "",
113-
"unet_lr": 0.0,
114-
"unit": 1,
115-
"up_lr_weight": "",
116-
"use_cp": false,
117-
"use_scalar": false,
118-
"use_tucker": false,
11985
"use_wandb": false,
12086
"v2": false,
12187
"v_parameterization": false,
12288
"v_pred_like_loss": 0,
123-
"vae": "",
89+
"vae": "stabilityai/vae",
12490
"vae_batch_size": 0,
12591
"wandb_api_key": "",
12692
"wandb_run_name": "",

0 commit comments

Comments
 (0)