Bernard Maltais commited on
Commit ·
91b4aec
1
Parent(s): 349ec68
Update training script
Browse files
kohya_diffusers_train.ps1
CHANGED
|
@@ -5,7 +5,7 @@ $pretrained_model_name_or_path = "D:\models\v1-5-pruned-mse-vae.ckpt"
|
|
| 5 |
$train_dir = "D:\dreambooth\train_lego"
|
| 6 |
$training_folder = "raw"
|
| 7 |
|
| 8 |
-
$learning_rate =
|
| 9 |
$dataset_repeats = 40
|
| 10 |
$train_batch_size = 8
|
| 11 |
$epoch = 4
|
|
@@ -13,7 +13,7 @@ $save_every_n_epochs=1
|
|
| 13 |
$mixed_precision="bf16"
|
| 14 |
$num_cpu_threads_per_process=6
|
| 15 |
|
| 16 |
-
$max_resolution = "
|
| 17 |
|
| 18 |
# You should not have to change values past this point
|
| 19 |
|
|
@@ -28,7 +28,7 @@ $ErrorActionPreference = "Stop"
|
|
| 28 |
$caption="lego set"
|
| 29 |
|
| 30 |
$files = Get-ChildItem $train_dir\$training_folder\"*.*" -Include *.png,*.jpg,*.webp
|
| 31 |
-
foreach ($file in $files) {New-Item -ItemType file -Path $train_dir\$training_folder -Name "$($file.BaseName).txt" -Value $caption}
|
| 32 |
|
| 33 |
|
| 34 |
# create caption json file
|
|
@@ -50,6 +50,7 @@ $repeats = $image_num * $dataset_repeats
|
|
| 50 |
# calculate max_train_set
|
| 51 |
$max_train_set = [Math]::Ceiling($repeats / $train_batch_size * $epoch)
|
| 52 |
|
|
|
|
| 53 |
accelerate launch --num_cpu_threads_per_process $num_cpu_threads_per_process D:\kohya_ss\diffusers_fine_tuning\fine_tune.py `
|
| 54 |
--pretrained_model_name_or_path=$pretrained_model_name_or_path `
|
| 55 |
--in_json $train_dir"\meta_lat.json" `
|
|
|
|
| 5 |
$train_dir = "D:\dreambooth\train_lego"
|
| 6 |
$training_folder = "raw"
|
| 7 |
|
| 8 |
+
$learning_rate = 1e-6
|
| 9 |
$dataset_repeats = 40
|
| 10 |
$train_batch_size = 8
|
| 11 |
$epoch = 4
|
|
|
|
| 13 |
$mixed_precision="bf16"
|
| 14 |
$num_cpu_threads_per_process=6
|
| 15 |
|
| 16 |
+
$max_resolution = "576,576"
|
| 17 |
|
| 18 |
# You should not have to change values past this point
|
| 19 |
|
|
|
|
| 28 |
$caption="lego set"
|
| 29 |
|
| 30 |
$files = Get-ChildItem $train_dir\$training_folder\"*.*" -Include *.png,*.jpg,*.webp
|
| 31 |
+
foreach ($file in $files) {New-Item -ItemType file -Path $train_dir\$training_folder -Name "$($file.BaseName).txt" -Value $caption -Force}
|
| 32 |
|
| 33 |
|
| 34 |
# create caption json file
|
|
|
|
| 50 |
# calculate max_train_set
|
| 51 |
$max_train_set = [Math]::Ceiling($repeats / $train_batch_size * $epoch)
|
| 52 |
|
| 53 |
+
|
| 54 |
accelerate launch --num_cpu_threads_per_process $num_cpu_threads_per_process D:\kohya_ss\diffusers_fine_tuning\fine_tune.py `
|
| 55 |
--pretrained_model_name_or_path=$pretrained_model_name_or_path `
|
| 56 |
--in_json $train_dir"\meta_lat.json" `
|