Certainly! Here's your accelerate launch command rearranged for better readability and logical grouping. The arguments are organized into categories such as Execution Settings, Paths & Data, Image & Data Augmentation, Network Configuration, Training Parameters, Optimizer Settings, Precision & Performance, and Caching & Bucketing.
!accelerate launch --num_cpu_threads_per_process=16 "./sd-scripts/sdxl_train_network.py" \
# ===== Execution Settings =====
--output_name="sdxl-dreambooth-lora" \
# ===== Paths & Data =====
--pretrained_model_name_or_path="/kaggle/input/illustriousxl-v01/illustriousXL_v01.safetensors" \
--train_data_dir="/kaggle/temp/training-data/img" \
--reg_data_dir="/kaggle/temp/training-data/reg" \
--output_dir="/kaggle/working/my-dreambooth-lora" \
--logging_dir="/kaggle/temp/training-data/log" \
--caption_extension=".txt" \
# ===== Image & Data Augmentation =====
--resolution="1024,1024" \
--flip_aug \
--shuffle_caption \
--noise_offset=0.0375 \
# ===== Network Configuration =====
--network_module=networks.lora \
--network_alpha=1 \
--network_dim=32 \
--keep_tokens=1 \
# ===== Training Parameters =====
--train_batch_size=8 \
--vae_batch_size=2 \
--max_train_steps=65536 \
--save_every_n_epochs=32 \
--gradient_checkpointing \
# ===== Optimizer Settings =====
--text_encoder_lr=0.0002 \
--unet_lr=0.0004 \
--optimizer_type="Adafactor" \
--optimizer_args scale_parameter=False relative_step=False warmup_init=False \
--lr_scheduler="constant" \
--lr_scheduler_num_cycles=8 \
# ===== Precision & Performance =====
--mixed_precision="fp16" \
--save_precision="fp16" \
--full_fp16 \
--no_half_vae \
--mem_eff_attn \
--xformers \
# ===== Caching & Bucketing =====
--enable_bucket \
--bucket_reso_steps=64 \
--bucket_no_upscale \
--cache_latents \
--cache_latents_to_disk \
# ===== Data Loading =====
--max_data_loader_n_workers=16 \
# ===== Saving & Model =====
--save_model_as=safetensors
Explanation of Groups:
-
Execution Settings:
--output_name: Specifies the name of the output model.
-
Paths & Data:
- Model and Dataset Paths: Defines where to find pre-trained models, training data, regularization data, output directory, and logging directory.
--caption_extension: Specifies the file extension for captions.
-
Image & Data Augmentation:
- Image Resolution: Sets the resolution for training images.
- Augmentation Flags: Enables flipping augmentations, shuffling captions, and sets noise offset.
-
Network Configuration:
- LoRA Settings: Defines the network module, alpha, dimension, and token retention for the LoRA architecture.
-
Training Parameters:
- Batch Sizes and Steps: Sets training and VAE batch sizes, maximum training steps, and epoch intervals for saving models.
--gradient_checkpointing: Enables gradient checkpointing to save memory.
-
Optimizer Settings:
- Learning Rates: Sets learning rates for text encoder and UNet.
- Optimizer Type & Arguments: Chooses the optimizer and its specific arguments.
- Learning Rate Scheduler: Configures the learning rate scheduler type and cycles.
-
Precision & Performance:
- Mixed Precision: Enables mixed precision training with FP16.
- Memory Efficient Attention: Utilizes memory-efficient attention mechanisms.
--xformers: Enables XFormers for optimized transformer operations.
-
Caching & Bucketing:
- Bucket Settings: Enables bucketing, sets resolution steps, and disables upscaling.
- Caching Latents: Enables caching of latent representations to disk for faster training.
-
Data Loading:
- Workers: Sets the number of worker threads for data loading.
-
Saving & Model:
- Model Format: Specifies the format in which to save the model (safetensors).
Notes:
- Typo Correction: Changed
--loggi ng_dir to --logging_dir.
- Line Breaks & Comments: Added comments for clarity and used backslashes (
\) for line continuation to enhance readability.
- Grouping Logic: Arguments are grouped based on their functionality and role in the training process.
Feel free to adjust the grouping or ordering based on your specific preferences or requirements!