赞
踩
https://github.com/kohya-ss/sd-scripts/blob/main/docs/config_README-ja.mdhttps://github.com/kohya-ss/sd-scripts/blob/main/docs/config_README-ja.md[Stable Diffusion]训练你的LoRA(Linux) - 知乎简介LoRA 是一种参数高效微调方法(PEFT),最早由 LoRA: Low-Rank Adaptation of Large Language Models 提出并应用于微调语言大模型之中,后来由 Low-rank Adaptation for Fast Text-to-Image Diffusion Fine-tu…https://zhuanlan.zhihu.com/p/640144661配置文件格式TOML:
- [general]
- shuffle_caption = true
- caption_extension = '.txt'
- keep_tokens = 1
-
- # This is a DreamBooth-style dataset
- [[datasets]]
- resolution = 512
- batch_size = 4
- keep_tokens = 2
-
- [[datasets.subsets]]
- image_dir = 'C:\hoge'
- class_tokens = 'hoge girl'
- # This subset has keep_tokens = 2 (using the value of the parent datasets)
-
- [[datasets.subsets]]
- image_dir = 'C:\fuga'
- class_tokens = 'fuga boy'
- keep_tokens = 3
-
- [[datasets.subsets]]
- is_reg = true
- image_dir = 'C:\reg'
- class_tokens = 'human'
- keep_tokens = 1
-
- # This is a fine-tuning-style dataset
- [[datasets]]
- resolution = [768, 768]
- batch_size = 2
-
- [[datasets.subsets]]
- image_dir = 'C:\piyo'
- metadata_file = 'C:\piyo\piyo_md.json'
- # This subset has keep_tokens = 1 (using the general value)
在此示例中,将训练三个目录作为512x512(批量大小4)的dreambooth数据集,以及一个目录作为768x768(批量大小2)的微调数据集。
- C:\
- ├─ hoge -> [[datasets.subsets]] No.1 ┐ ┐
- ├─ fuga -> [[datasets.subsets]] No.2 |-> [[datasets]] No.1 |-> [general]
- ├─ reg -> [[datasets.subsets]] No.3 ┘ |
- └─ piyo -> [[datasets.subsets]] No.4 --> [[datasets]] No.2 ┘
所有方法均可使用的参数:[general]
dreambooth-style 特有的参数:
fine-tuning-style特有的参数:
train_db.py参数
- [-h] [--v2] [--v_parameterization]
- [--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH]
- [--tokenizer_cache_dir TOKENIZER_CACHE_DIR]
- [--train_data_dir TRAIN_DATA_DIR]
- [--shuffle_caption]
- [--caption_extension CAPTION_EXTENSION]
- [--caption_extention CAPTION_EXTENTION]
- [--keep_tokens KEEP_TOKENS]
- [--caption_prefix CAPTION_PREFIX]
- [--caption_suffix CAPTION_SUFFIX]
- [--color_aug]
- [--flip_aug]
- [--face_crop_aug_range FACE_CROP_AUG_RANGE]
- [--random_crop]
- [--debug_dataset]
- [--resolution RESOLUTION]
- [--cache_latents]
- [--vae_batch_size VAE_BATCH_SIZE]
- [--cache_latents_to_disk]
- [--enable_bucket]
- [--min_bucket_reso MIN_BUCKET_RESO]
- [--max_bucket_reso MAX_BUCKET_RESO]
- [--bucket_reso_steps BUCKET_RESO_STEPS]
- [--bucket_no_upscale]
- [--token_warmup_min TOKEN_WARMUP_MIN]
- [--token_warmup_step TOKEN_WARMUP_STEP]
- [--dataset_class DATASET_CLASS]
- [--caption_dropout_rate CAPTION_DROPOUT_RATE]
- [--caption_dropout_every_n_epochs CAPTION_DROPOUT_EVERY_N_EPOCHS]
- [--caption_tag_dropout_rate CAPTION_TAG_DROPOUT_RATE]
- [--reg_data_dir REG_DATA_DIR]
- [--output_dir OUTPUT_DIR]
- [--output_name OUTPUT_NAME]
- [--huggingface_repo_id HUGGINGFACE_REPO_ID]
- [--huggingface_repo_type HUGGINGFACE_REPO_TYPE]
- [--huggingface_path_in_repo HUGGINGFACE_PATH_IN_REPO]
- [--huggingface_token HUGGINGFACE_TOKEN]
- [--huggingface_repo_visibility HUGGINGFACE_REPO_VISIBILITY]
- [--save_state_to_huggingface]
- [--resume_from_huggingface]
- [--async_upload]
- [--save_precision {None,float,fp16,bf16}]
- [--save_every_n_epochs SAVE_EVERY_N_EPOCHS]
- [--save_every_n_steps SAVE_EVERY_N_STEPS]
- [--save_n_epoch_ratio SAVE_N_EPOCH_RATIO]
- [--save_last_n_epochs SAVE_LAST_N_EPOCHS]
- [--save_last_n_epochs_state SAVE_LAST_N_EPOCHS_STATE]
- [--save_last_n_steps SAVE_LAST_N_STEPS]
- [--save_last_n_steps_state SAVE_LAST_N_STEPS_STATE]
- [--save_state]
- [--resume RESUME]
- [--train_batch_size TRAIN_BATCH_SIZE]
- [--max_token_length {None,150,225}]
- [--mem_eff_attn]
- [--xformers]
- [--sdpa]
- [--vae VAE]
- [--max_train_steps MAX_TRAIN_STEPS]
- [--max_train_epochs MAX_TRAIN_EPOCHS]
- [--max_data_loader_n_workers MAX_DATA_LOADER_N_WORKERS]
- [--persistent_data_loader_workers]
- [--seed SEED]
- [--gradient_checkpointing]
- [--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS]
- [--mixed_precision {no,fp16,bf16}]
- [--full_fp16]
- [--full_bf16]
- [--ddp_timeout DDP_TIMEOUT]
- [--clip_skip CLIP_SKIP]
- [--logging_dir LOGGING_DIR]
- [--log_with {tensorboard,wandb,all}]
- [--log_prefix LOG_PREFIX]
- [--log_tracker_name LOG_TRACKER_NAME]
- [--log_tracker_config LOG_TRACKER_CONFIG]
- [--wandb_api_key WANDB_API_KEY]
- [--noise_offset NOISE_OFFSET]
- [--multires_noise_iterations MULTIRES_NOISE_ITERATIONS]
- [--ip_noise_gamma IP_NOISE_GAMMA]
- [--multires_noise_discount MULTIRES_NOISE_DISCOUNT]
- [--adaptive_noise_scale ADAPTIVE_NOISE_SCALE]
- [--zero_terminal_snr]
- [--min_timestep MIN_TIMESTEP]
- [--max_timestep MAX_TIMESTEP]
- [--lowram]
- [--sample_every_n_steps SAMPLE_EVERY_N_STEPS]
- [--sample_every_n_epochs SAMPLE_EVERY_N_EPOCHS]
- [--sample_prompts SAMPLE_PROMPTS]
- [--sample_sampler {ddim,pndm,lms,euler,euler_a,heun,dpm_2,dpm_2_a,dpmsolver,dpmsolver++,dpmsingle,k_lms,k_euler,k_euler_a,k_dpm_2,k_dpm_2_a}]
- [--config_file CONFIG_FILE]
- [--output_config]
- [--metadata_title METADATA_TITLE]
- [--metadata_author METADATA_AUTHOR]
- [--metadata_description METADATA_DESCRIPTION]
- [--metadata_license METADATA_LICENSE]
- [--metadata_tags METADATA_TAGS]
- [--prior_loss_weight PRIOR_LOSS_WEIGHT]
- [--save_model_as {None,ckpt,safetensors,diffusers,diffusers_safetensors}]
- [--use_safetensors]
- [--optimizer_type OPTIMIZER_TYPE]
- [--use_8bit_adam]
- [--use_lion_optimizer]
- [--learning_rate LEARNING_RATE]
- [--max_grad_norm MAX_GRAD_NORM]
- [--optimizer_args [OPTIMIZER_ARGS [OPTIMIZER_ARGS ...]]]
- [--lr_scheduler_type LR_SCHEDULER_TYPE]
- [--lr_scheduler_args [LR_SCHEDULER_ARGS [LR_SCHEDULER_ARGS ...]]]
- [--lr_scheduler LR_SCHEDULER]
- [--lr_warmup_steps LR_WARMUP_STEPS]
- [--lr_scheduler_num_cycles LR_SCHEDULER_NUM_CYCLES]
- [--lr_scheduler_power LR_SCHEDULER_POWER]
- [--dataset_config DATASET_CONFIG]
- [--min_snr_gamma MIN_SNR_GAMMA]
- [--scale_v_pred_loss_like_noise_pred]
- [--v_pred_like_loss V_PRED_LIKE_LOSS]
- [--debiased_estimation_loss]
- [--weighted_captions]
- [--learning_rate_te LEARNING_RATE_TE]
- [--no_token_padding]
- [--stop_text_encoder_training STOP_TEXT_ENCODER_TRAINING]
train_network.py
- [-h] [--v2] [--v_parameterization]
- [--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH]
- [--tokenizer_cache_dir TOKENIZER_CACHE_DIR]
- [--train_data_dir TRAIN_DATA_DIR]
- [--shuffle_caption]
- [--caption_extension CAPTION_EXTENSION]
- [--caption_extention CAPTION_EXTENTION]
- [--keep_tokens KEEP_TOKENS]
- [--caption_prefix CAPTION_PREFIX]
- [--caption_suffix CAPTION_SUFFIX]
- [--color_aug]
- [--flip_aug]
- [--face_crop_aug_range FACE_CROP_AUG_RANGE]
- [--random_crop]
- [--debug_dataset]
- [--resolution RESOLUTION]
- [--cache_latents]
- [--vae_batch_size VAE_BATCH_SIZE]
- [--cache_latents_to_disk]
- [--enable_bucket]
- [--min_bucket_reso MIN_BUCKET_RESO]
- [--max_bucket_reso MAX_BUCKET_RESO]
- [--bucket_reso_steps BUCKET_RESO_STEPS]
- [--bucket_no_upscale]
- [--token_warmup_min TOKEN_WARMUP_MIN]
- [--token_warmup_step TOKEN_WARMUP_STEP]
- [--dataset_class DATASET_CLASS]
- [--caption_dropout_rate CAPTION_DROPOUT_RATE]
- [--caption_dropout_every_n_epochs CAPTION_DROPOUT_EVERY_N_EPOCHS]
- [--caption_tag_dropout_rate CAPTION_TAG_DROPOUT_RATE]
- [--reg_data_dir REG_DATA_DIR]
- [--in_json IN_JSON]
- [--dataset_repeats DATASET_REPEATS]
- [--output_dir OUTPUT_DIR]
- [--output_name OUTPUT_NAME]
- [--huggingface_repo_id HUGGINGFACE_REPO_ID]
- [--huggingface_repo_type HUGGINGFACE_REPO_TYPE]
- [--huggingface_path_in_repo HUGGINGFACE_PATH_IN_REPO]
- [--huggingface_token HUGGINGFACE_TOKEN]
- [--huggingface_repo_visibility HUGGINGFACE_REPO_VISIBILITY]
- [--save_state_to_huggingface]
- [--resume_from_huggingface]
- [--async_upload]
- [--save_precision {None,float,fp16,bf16}]
- [--save_every_n_epochs SAVE_EVERY_N_EPOCHS]
- [--save_every_n_steps SAVE_EVERY_N_STEPS]
- [--save_n_epoch_ratio SAVE_N_EPOCH_RATIO]
- [--save_last_n_epochs SAVE_LAST_N_EPOCHS]
- [--save_last_n_epochs_state SAVE_LAST_N_EPOCHS_STATE]
- [--save_last_n_steps SAVE_LAST_N_STEPS]
- [--save_last_n_steps_state SAVE_LAST_N_STEPS_STATE]
- [--save_state]
- [--resume RESUME]
- [--train_batch_size TRAIN_BATCH_SIZE]
- [--max_token_length {None,150,225}]
- [--mem_eff_attn]
- [--xformers]
- [--sdpa]
- [--vae VAE]
- [--max_train_steps MAX_TRAIN_STEPS]
- [--max_train_epochs MAX_TRAIN_EPOCHS]
- [--max_data_loader_n_workers MAX_DATA_LOADER_N_WORKERS]
- [--persistent_data_loader_workers]
- [--seed SEED]
- [--gradient_checkpointing]
- [--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS]
- [--mixed_precision {no,fp16,bf16}]
- [--full_fp16]
- [--full_bf16]
- [--ddp_timeout DDP_TIMEOUT]
- [--clip_skip CLIP_SKIP]
- [--logging_dir LOGGING_DIR]
- [--log_with {tensorboard,wandb,all}]
- [--log_prefix LOG_PREFIX]
- [--log_tracker_name LOG_TRACKER_NAME]
- [--log_tracker_config LOG_TRACKER_CONFIG]
- [--wandb_api_key WANDB_API_KEY]
- [--noise_offset NOISE_OFFSET]
- [--multires_noise_iterations MULTIRES_NOISE_ITERATIONS]
- [--ip_noise_gamma IP_NOISE_GAMMA]
- [--multires_noise_discount MULTIRES_NOISE_DISCOUNT]
- [--adaptive_noise_scale ADAPTIVE_NOISE_SCALE]
- [--zero_terminal_snr]
- [--min_timestep MIN_TIMESTEP]
- [--max_timestep MAX_TIMESTEP]
- [--lowram]
- [--sample_every_n_steps SAMPLE_EVERY_N_STEPS]
- [--sample_every_n_epochs SAMPLE_EVERY_N_EPOCHS]
- [--sample_prompts SAMPLE_PROMPTS]
- [--sample_sampler {ddim,pndm,lms,euler,euler_a,heun,dpm_2,dpm_2_a,dpmsolver,dpmsolver++,dpmsingle,k_lms,k_euler,k_euler_a,k_dpm_2,k_dpm_2_a}]
- [--config_file CONFIG_FILE]
- [--output_config]
- [--metadata_title METADATA_TITLE]
- [--metadata_author METADATA_AUTHOR]
- [--metadata_description METADATA_DESCRIPTION]
- [--metadata_license METADATA_LICENSE]
- [--metadata_tags METADATA_TAGS]
- [--prior_loss_weight PRIOR_LOSS_WEIGHT]
- [--optimizer_type OPTIMIZER_TYPE]
- [--use_8bit_adam]
- [--use_lion_optimizer]
- [--learning_rate LEARNING_RATE]
- [--max_grad_norm MAX_GRAD_NORM]
- [--optimizer_args [OPTIMIZER_ARGS ...]]
- [--lr_scheduler_type LR_SCHEDULER_TYPE]
- [--lr_scheduler_args [LR_SCHEDULER_ARGS ...]]
- [--lr_scheduler LR_SCHEDULER]
- [--lr_warmup_steps LR_WARMUP_STEPS]
- [--lr_scheduler_num_cycles LR_SCHEDULER_NUM_CYCLES]
- [--lr_scheduler_power LR_SCHEDULER_POWER]
- [--dataset_config DATASET_CONFIG]
- [--min_snr_gamma MIN_SNR_GAMMA]
- [--scale_v_pred_loss_like_noise_pred]
- [--v_pred_like_loss V_PRED_LIKE_LOSS]
- [--debiased_estimation_loss]
- [--weighted_captions]
- [--no_metadata]
- [--save_model_as {None,ckpt,pt,safetensors}]
- [--unet_lr UNET_LR]
- [--text_encoder_lr TEXT_ENCODER_LR]
- [--network_weights NETWORK_WEIGHTS]
- [--network_module NETWORK_MODULE]
- [--network_dim NETWORK_DIM]
- [--network_alpha NETWORK_ALPHA]
- [--network_dropout NETWORK_DROPOUT]
- [--network_args [NETWORK_ARGS ...]]
- [--network_train_unet_only]
- [--network_train_text_encoder_only]
- [--training_comment TRAINING_COMMENT]
- [--dim_from_weights]
- [--scale_weight_norms SCALE_WEIGHT_NORMS]
- [--base_weights [BASE_WEIGHTS ...]]
- [--base_weights_multiplier [BASE_WEIGHTS_MULTIPLIER ...]]
- [--no_half_vae]
-
-
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。