Bernard Maltais commited on
Commit ·
655a0f0
1
Parent(s): 3003072
1st commit
Browse files- 1.png +0 -0
- 2.png +0 -0
- 3.png +0 -0
- README.md +28 -0
- by_soda_stream.ckpt +3 -0
- kohya_diffusers_train.ps1 +80 -0
1.png
ADDED
|
2.png
ADDED
|
3.png
ADDED
|
README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: unknown
|
| 3 |
+
---
|
| 4 |
+
# Soda Stream finetuned style Model
|
| 5 |
+
|
| 6 |
+
Produced from publicly available pictures in landscape, portrait and square format.
|
| 7 |
+
|
| 8 |
+
## Model info
|
| 9 |
+
|
| 10 |
+
The models included was trained on "multi-resolution" images.
|
| 11 |
+
|
| 12 |
+
## Using the model
|
| 13 |
+
|
| 14 |
+
* common subject prompt tokens: `<wathever> by soda stream`
|
| 15 |
+
|
| 16 |
+
## Example prompts
|
| 17 |
+
|
| 18 |
+
`woman near a fountain by soda stream`:
|
| 19 |
+
|
| 20 |
+
<img src="https://huggingface.co/cyburn/lego_set/resolve/main/1.png" alt="Picture." width="500"/>
|
| 21 |
+
|
| 22 |
+
`woman in taxi by soda stream`:
|
| 23 |
+
|
| 24 |
+
<img src="https://huggingface.co/cyburn/lego_set/resolve/main/2.png" alt="Picture." width="500"/>
|
| 25 |
+
|
| 26 |
+
`woman portrait by soda stream`:
|
| 27 |
+
|
| 28 |
+
<img src="https://huggingface.co/cyburn/lego_set/resolve/main/3.png" alt="Picture." width="500"/>
|
by_soda_stream.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eed7686d1d6e7c78fdc0e58cf510abac386be37d43326762728c5d72193c9cf9
|
| 3 |
+
size 2132856686
|
kohya_diffusers_train.ps1
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# by soda stream
|
| 2 |
+
|
| 3 |
+
# variable values
|
| 4 |
+
$pretrained_model_name_or_path = "D:\models\v1-5-pruned-mse-vae.ckpt"
|
| 5 |
+
$train_dir = "D:\dreambooth\train_sandosart"
|
| 6 |
+
$training_folder = "raw"
|
| 7 |
+
|
| 8 |
+
$learning_rate = 1e-6
|
| 9 |
+
$dataset_repeats = 40
|
| 10 |
+
$train_batch_size = 8
|
| 11 |
+
$epoch = 4
|
| 12 |
+
$save_every_n_epochs=1
|
| 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 |
+
|
| 20 |
+
# stop script on error
|
| 21 |
+
$ErrorActionPreference = "Stop"
|
| 22 |
+
|
| 23 |
+
# activate venv
|
| 24 |
+
.\venv\Scripts\activate
|
| 25 |
+
|
| 26 |
+
# Usefull to create base caption that will be augmented on a per image basis
|
| 27 |
+
|
| 28 |
+
$caption="by soda stream"
|
| 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
|
| 35 |
+
python D:\kohya_ss\diffusers_fine_tuning\merge_captions_to_metadata-ber.py `
|
| 36 |
+
--caption_extention ".txt" $train_dir"\"$training_folder $train_dir"\meta_cap.json"
|
| 37 |
+
|
| 38 |
+
# create images buckets
|
| 39 |
+
python D:\kohya_ss\diffusers_fine_tuning\prepare_buckets_latents-ber.py `
|
| 40 |
+
$train_dir"\"$training_folder `
|
| 41 |
+
$train_dir"\meta_cap.json" `
|
| 42 |
+
$train_dir"\meta_lat.json" `
|
| 43 |
+
$pretrained_model_name_or_path `
|
| 44 |
+
--batch_size 4 --max_resolution $max_resolution --mixed_precision fp16
|
| 45 |
+
|
| 46 |
+
# Get number of valid images
|
| 47 |
+
$image_num = Get-ChildItem "$train_dir\$training_folder" -Recurse -File -Include *.npz | Measure-Object | %{$_.Count}
|
| 48 |
+
$repeats = $image_num * $dataset_repeats
|
| 49 |
+
|
| 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" `
|
| 56 |
+
--train_data_dir=$train_dir"\"$training_folder `
|
| 57 |
+
--output_dir=$train_dir"\fine_tuned2" `
|
| 58 |
+
--train_batch_size=$train_batch_size `
|
| 59 |
+
--dataset_repeats=$dataset_repeats `
|
| 60 |
+
--learning_rate=$learning_rate `
|
| 61 |
+
--max_train_steps=$max_train_set `
|
| 62 |
+
--use_8bit_adam --xformers `
|
| 63 |
+
--mixed_precision=$mixed_precision `
|
| 64 |
+
--save_every_n_epochs=$save_every_n_epochs `
|
| 65 |
+
--train_text_encoder `
|
| 66 |
+
--save_precision="fp16"
|
| 67 |
+
|
| 68 |
+
# accelerate launch --num_cpu_threads_per_process $num_cpu_threads_per_process D:\kohya_ss\diffusers_fine_tuning\fine_tune_v1-ber.py `
|
| 69 |
+
# --pretrained_model_name_or_path=$train_dir"\fine_tuned\last.ckpt" `
|
| 70 |
+
# --in_json $train_dir"\meta_lat.json" `
|
| 71 |
+
# --train_data_dir=$train_dir"\"$training_folder `
|
| 72 |
+
# --output_dir=$train_dir"\fine_tuned2" `
|
| 73 |
+
# --train_batch_size=$train_batch_size `
|
| 74 |
+
# --dataset_repeats=$([Math]::Ceiling($dataset_repeats / 2)) `
|
| 75 |
+
# --learning_rate=$learning_rate `
|
| 76 |
+
# --max_train_steps=$([Math]::Ceiling($max_train_set / 2)) `
|
| 77 |
+
# --use_8bit_adam --xformers `
|
| 78 |
+
# --mixed_precision=$mixed_precision `
|
| 79 |
+
# --save_every_n_epochs=$save_every_n_epochs `
|
| 80 |
+
# --save_half
|