Skip to content

Commit

Permalink
Merge pull request #1540 from bmaltais/dev2
Browse files Browse the repository at this point in the history
v21.8.10
  • Loading branch information
bmaltais authored Sep 23, 2023
2 parents ed4e3b0 + 5449d1b commit c883fac
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v21.8.9
v21.8.10
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ If you come across a `FileNotFoundError`, it is likely due to an installation is

## Change History

* 2023/09/23 (v21.8.10)
- Minor point upgrade. Mostly adding a new preset.

* 2023/08/05 (v21.8.9)
- Update sd-script to caode as of Sept 3 2023
* ControlNet-LLLite is added. See documentation for details.
Expand All @@ -541,4 +544,4 @@ If you come across a `FileNotFoundError`, it is likely due to an installation is
* Input perturbation noise is added. See #798 for details.
* Dataset subset now has caption_prefix and caption_suffix options. The strings are added to the beginning and the end of the captions before shuffling. You can specify the options in .toml.
* Other minor changes.
- Added support fir Chinese locallisation
- Added support for Chinese locallisation
2 changes: 1 addition & 1 deletion finetune/make_captions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import torch
from torchvision import transforms
from torchvision.transforms.functional import InterpolationMode
sys.path.append(os.path.dirname(__file__))
sys.path.append(os.path.join(os.path.dirname(__file__), '..')) # sys.path.append(os.path.dirname(__file__))
from blip.blip import blip_decoder
import library.train_util as train_util

Expand Down
97 changes: 97 additions & 0 deletions presets/lora/SDXL - LoRA face dogu_cat v1.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"LoRA_type": "Standard",
"adaptive_noise_scale": 0.00357,
"additional_parameters": "",
"block_alphas": "",
"block_dims": "",
"block_lr_zero_threshold": "",
"bucket_no_upscale": false,
"bucket_reso_steps": 32,
"cache_latents": true,
"cache_latents_to_disk": true,
"caption_dropout_every_n_epochs": 0.0,
"caption_dropout_rate": 0,
"caption_extension": ".txt",
"clip_skip": "1",
"color_aug": false,
"conv_alpha": 4,
"conv_block_alphas": "",
"conv_block_dims": "",
"conv_dim": 4,
"decompose_both": false,
"dim_from_weights": false,
"down_lr_weight": "",
"enable_bucket": true,
"epoch": 10,
"factor": -1,
"flip_aug": false,
"full_bf16": false,
"full_fp16": false,
"gradient_accumulation_steps": 1,
"gradient_checkpointing": true,
"keep_tokens": 1,
"learning_rate": 0.0001,
"lora_network_weights": "",
"lr_scheduler": "cosine",
"lr_scheduler_args": "",
"lr_scheduler_num_cycles": "1",
"lr_scheduler_power": "",
"lr_warmup": 0,
"max_bucket_reso": 2048,
"max_data_loader_n_workers": "0",
"max_resolution": "1024,1024",
"max_timestep": 1000,
"max_token_length": "75",
"max_train_epochs": "",
"max_train_steps": "",
"mem_eff_attn": false,
"mid_lr_weight": "",
"min_bucket_reso": 64,
"min_snr_gamma": 0,
"min_timestep": 0,
"mixed_precision": "bf16",
"module_dropout": 0,
"multires_noise_discount": 0,
"multires_noise_iterations": 0,
"network_alpha": 46,
"network_dim": 92,
"network_dropout": 0,
"no_token_padding": false,
"noise_offset": 0.0357,
"noise_offset_type": "Original",
"num_cpu_threads_per_process": 2,
"optimizer": "AdamW8bit",
"optimizer_args": "",
"persistent_data_loader_workers": false,
"prior_loss_weight": 1.0,
"random_crop": false,
"rank_dropout": 0,
"save_every_n_epochs": 2,
"save_every_n_steps": 0,
"save_last_n_steps": 0,
"save_last_n_steps_state": 0,
"save_precision": "bf16",
"scale_v_pred_loss_like_noise_pred": false,
"scale_weight_norms": 1,
"sdxl": true,
"sdxl_cache_text_encoder_outputs": false,
"sdxl_no_half_vae": true,
"seed": "12345",
"shuffle_caption": false,
"stop_text_encoder_training_pct": 0,
"text_encoder_lr": 0.0001,
"train_batch_size": 1,
"train_on_input": false,
"training_comment": "Good for faces. Use 20 1024x1024 cropped images, 20 repeats, Blip captions, but 'woman' replaced with 'khls woman', https://civitai.com/user/dogu_cat/models",
"unet_lr": 0.0001,
"unit": 1,
"up_lr_weight": "",
"use_cp": false,
"use_wandb": false,
"v2": false,
"v_parameterization": false,
"v_pred_like_loss": 0,
"vae_batch_size": 0,
"weighted_captions": false,
"xformers": "xformers"
}
32 changes: 32 additions & 0 deletions tools/create_txt_from_images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import os
import argparse

def main(folder_path):
# Validate if the folder exists
if not os.path.exists(folder_path):
print("The specified folder does not exist.")
return

# Loop through all files in the directory
for filename in os.listdir(folder_path):
# Check if the file is an image file (webp, jpg, png)
if filename.lower().endswith(('.webp', '.jpg', '.png')):
# Remove the file extension from the filename
name_without_extension = os.path.splitext(filename)[0]

# Construct the name of the txt file
txt_filename = f"{name_without_extension}.txt"

# Extract the content before the underscore
content = name_without_extension.split("_")[0]

# Write the content to the txt file
with open(os.path.join(folder_path, txt_filename), "w") as txt_file:
txt_file.write(content)

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Process a folder.')
parser.add_argument('folder_path', type=str, help='Path to the folder to process')

args = parser.parse_args()
main(args.folder_path)

0 comments on commit c883fac

Please sign in to comment.