Kohya_ss_2 / sd-scripts /docs /train_network_advanced.md
ChBysk's picture
Upload folder using huggingface_hub
48cba3f verified
|
Raw
History Blame Contribute Delete
54 kB

A newer version of the Gradio SDK is available: 6.24.0

Upgrade

Advanced Settings: Detailed Guide for SDXL LoRA Training Script sdxl_train_network.py / 高床な蚭定: SDXL LoRA孊習スクリプト sdxl_train_network.py 詳现ガむド

This document describes the advanced options available when training LoRA models for SDXL (Stable Diffusion XL) with sdxl_train_network.py in the sd-scripts repository. For the basics, please read How to Use the LoRA Training Script train_network.py and How to Use the SDXL LoRA Training Script sdxl_train_network.py.

This guide targets experienced users who want to fine tune settings in detail.

Prerequisites:

  • You have cloned the sd-scripts repository and prepared a Python environment.
  • A training dataset and its .toml configuration are ready (see the Dataset Configuration Guide).
  • You are familiar with running basic LoRA training commands.

1. Command Line Options / コマンドラむン匕数 詳现解説

sdxl_train_network.py inherits the functionality of train_network.py and adds SDXL-specific features. Major options are grouped and explained below. For common arguments, see the other guides mentioned above.

1.1. Model Loading

  • --pretrained_model_name_or_path=\"<model path>\" [Required]: specify the base SDXL model. Supports a Hugging Face model ID, a local Diffusers directory or a .safetensors file.
  • --vae=\"<VAE path>\": optionally use a different VAE. Specify when using a VAE other than the one included in the SDXL model. Can specify .ckpt or .safetensors files.
  • --no_half_vae: keep the VAE in float32 even with fp16/bf16 training. The VAE for SDXL can become unstable with float16, so it is recommended to enable this when fp16 is specified. Usually unnecessary for bf16.
  • --fp8_base / --fp8_base_unet: Experimental: load the base model (U-Net, Text Encoder) or just the U-Net in FP8 to reduce VRAM (requires PyTorch 2.1+). For details, refer to the relevant section in TODO add document later (this is an SD3 explanation but also applies to SDXL).

1.2. Dataset Settings

  • --dataset_config=\"<path to config>\": specify a .toml dataset config. High resolution data and aspect ratio buckets (specify enable_bucket = true in .toml) are common for SDXL. The resolution steps for aspect ratio buckets (bucket_reso_steps) must be multiples of 32 for SDXL. For details on writing .toml files, refer to the Dataset Configuration Guide.

1.3. Output and Saving

Options match train_network.py:

  • --output_dir, --output_name (both required)
  • --save_model_as (recommended safetensors), ckpt, pt, diffusers, diffusers_safetensors
  • --save_precision=\"fp16\", \"bf16\", \"float\": Specifies the precision for saving the model. If not specified, the model is saved with the training precision (fp16, bf16, etc.).
  • --save_every_n_epochs=N, --save_every_n_steps=N: Saves the model every N epochs/steps.
  • --save_last_n_epochs=M, --save_last_n_steps=M: When saving at every epoch/step, only the latest M files are kept, and older ones are deleted.
  • --save_state, --save_state_on_train_end: Saves the training state (state), including Optimizer status, etc., when saving the model or at the end of training. Required for resuming training with the --resume option.
  • --save_last_n_epochs_state=M, --save_last_n_steps_state=M: Limits the number of saved state files to M. Overrides the --save_last_n_epochs/steps specification.
  • --no_metadata: Does not save metadata to the output model.
  • --save_state_to_huggingface and related options (e.g., --huggingface_repo_id): Options related to uploading models and states to Hugging Face Hub. See TODO add document for details.

1.4. Network Parameters (LoRA)

  • --network_module=networks.lora [Required]
  • --network_dim=N [Required]: Specifies the rank (dimensionality) of LoRA. For SDXL, values like 32 or 64 are often tried, but adjustment is necessary depending on the dataset and purpose.
  • --network_alpha=M: LoRA alpha value. Generally around half of network_dim or the same value as network_dim. Default is 1.
  • --network_dropout=P: Dropout rate (0.0-1.0) within LoRA modules. Can be effective in suppressing overfitting. Default is None (no dropout).
  • --network_args ...: Allows advanced settings by specifying additional arguments to the network module in key=value format. For LoRA, the following advanced settings are available:
    • Block-wise dimensions/alphas:
      • Allows specifying different dim and alpha for each block of the U-Net. This enables adjustments to strengthen or weaken the influence of specific layers.
      • block_dims: Comma-separated dims for Linear and Conv2d 1x1 layers in U-Net (23 values for SDXL).
      • block_alphas: Comma-separated alpha values corresponding to the above.
      • conv_block_dims: Comma-separated dims for Conv2d 3x3 layers in U-Net.
      • conv_block_alphas: Comma-separated alpha values corresponding to the above.
      • Blocks not specified will use values from --network_dim/--network_alpha or --conv_dim/--conv_alpha (if they exist).
      • For details, refer to Block-wise learning rate for LoRA (in train_network.md, applicable to SDXL) and the implementation (lora.py).
    • LoRA+:
      • loraplus_lr_ratio=R: Sets the learning rate of LoRA's upward weights (UP) to R times the learning rate of downward weights (DOWN). Expected to improve learning speed. Paper recommends 16.
      • loraplus_unet_lr_ratio=RU: Specifies the LoRA+ learning rate ratio for the U-Net part individually.
      • loraplus_text_encoder_lr_ratio=RT: Specifies the LoRA+ learning rate ratio for the Text Encoder part individually (multiplied by the learning rates specified with --text_encoder_lr1, --text_encoder_lr2).
      • For details, refer to README and the implementation (lora.py).
  • --network_train_unet_only: Trains only the LoRA modules of the U-Net. Specify this if not training Text Encoders. Required when using --cache_text_encoder_outputs.
  • --network_train_text_encoder_only: Trains only the LoRA modules of the Text Encoders. Specify this if not training the U-Net.
  • --network_weights=\"<weight file>\": Starts training by loading pre-trained LoRA weights. Used for fine-tuning or resuming training. The difference from --resume is that this option only loads LoRA module weights, while --resume also restores Optimizer state, step count, etc.
  • --dim_from_weights: Automatically reads the LoRA dimension (dim) from the weight file specified by --network_weights. Specification of --network_dim becomes unnecessary.

1.5. Training Parameters

  • --learning_rate=LR: Sets the overall learning rate. This becomes the default value for each module (unet_lr, text_encoder_lr1, text_encoder_lr2). Values like 1e-3 or 1e-4 are often tried.
  • --unet_lr=LR_U: Learning rate for the LoRA module of the U-Net part.
  • --text_encoder_lr1=LR_TE1: Learning rate for the LoRA module of Text Encoder 1 (OpenCLIP ViT-G/14). Usually, a smaller value than U-Net (e.g., 1e-5, 2e-5) is recommended.
  • --text_encoder_lr2=LR_TE2: Learning rate for the LoRA module of Text Encoder 2 (CLIP ViT-L/14). Usually, a smaller value than U-Net (e.g., 1e-5, 2e-5) is recommended.
  • --optimizer_type=\"...\": Specifies the optimizer to use. Options include AdamW8bit (memory-efficient, common), Adafactor (even more memory-efficient, proven in SDXL full model training), Lion, DAdaptation, Prodigy, etc. Each optimizer may require additional arguments (see --optimizer_args). AdamW8bit or PagedAdamW8bit (requires bitsandbytes) are common. Adafactor is memory-efficient but slightly complex to configure (relative step (relative_step=True) recommended, adafactor learning rate scheduler recommended). DAdaptation, Prodigy have automatic learning rate adjustment but cannot be used with LoRA+. Specify a learning rate around 1.0. For details, see the get_optimizer function in train_util.py.
  • --optimizer_args ...: Specifies additional arguments to the optimizer in key=value format (e.g., \"weight_decay=0.01\" \"betas=0.9,0.999\").
  • --lr_scheduler=\"...\": Specifies the learning rate scheduler. Options include constant (no change), cosine (cosine curve), linear (linear decay), constant_with_warmup (constant with warmup), cosine_with_restarts, etc. constant, cosine, and constant_with_warmup are commonly used. Some schedulers require additional arguments (see --lr_scheduler_args). If using optimizers with auto LR adjustment like DAdaptation or Prodigy, a scheduler is not needed (constant should be specified).
  • --lr_warmup_steps=N: Number of warmup steps for the learning rate scheduler. The learning rate gradually increases during this period at the start of training. If N < 1, it's interpreted as a fraction of total steps.
  • --lr_scheduler_num_cycles=N / --lr_scheduler_power=P: Parameters for specific schedulers (cosine_with_restarts, polynomial).
  • --max_train_steps=N / --max_train_epochs=N: Specifies the total number of training steps or epochs. Epoch specification takes precedence.
  • --mixed_precision=\"bf16\" / \"fp16\" / \"no\": Mixed precision training settings. For SDXL, using bf16 (if GPU supports it) or fp16 is strongly recommended. Reduces VRAM usage and improves training speed.
  • --full_fp16 / --full_bf16: Performs gradient calculations entirely in half-precision/bf16. Can further reduce VRAM usage but may affect training stability. Use if VRAM is critically low.
  • --gradient_accumulation_steps=N: Accumulates gradients for N steps before updating the optimizer. Effectively increases the batch size to train_batch_size * N, achieving the effect of a larger batch size with less VRAM. Default is 1.
  • --max_grad_norm=N: Gradient clipping threshold. Clips gradients if their norm exceeds N. Default is 1.0. 0 disables it.
  • --gradient_checkpointing: Significantly reduces memory usage but slightly decreases training speed. Recommended for SDXL due to high memory consumption.
  • --fused_backward_pass: Experimental: Fuses gradient calculation and optimizer steps to reduce VRAM usage. Available for SDXL. Currently only supports Adafactor optimizer. Cannot be used with Gradient Accumulation.
  • --resume=\"<state directory>\": Resumes training from a saved state (saved with --save_state). Restores optimizer state, step count, etc.

1.6. Caching

Caching is effective for SDXL due to its high computational cost.

  • --cache_latents: Caches VAE outputs (latents) in memory. Skips VAE computation, reducing VRAM usage and speeding up training. Note: Image augmentations (color_aug, flip_aug, random_crop, etc.) will be disabled.
  • --cache_latents_to_disk: Used with --cache_latents to cache to disk. Particularly effective for large datasets or multiple training runs. Caches are generated on disk during the first run and loaded from there on subsequent runs.
  • --cache_text_encoder_outputs: Caches Text Encoder outputs in memory. Skips Text Encoder computation, reducing VRAM usage and speeding up training. Note: Caption augmentations (shuffle_caption, caption_dropout_rate, etc.) will be disabled. Also, when using this option, Text Encoder LoRA modules cannot be trained (requires --network_train_unet_only).
  • --cache_text_encoder_outputs_to_disk: Used with --cache_text_encoder_outputs to cache to disk.
  • --skip_cache_check: Skips validation of cache file contents. File existence is checked, and if not found, caches are generated. Usually not needed unless intentionally re-caching for debugging, etc.

1.7. Sample Image Generation

Basic options are common with train_network.py.

  • --sample_every_n_steps=N / --sample_every_n_epochs=N: Generates sample images every N steps/epochs.
  • --sample_at_first: Generates sample images before training starts.
  • --sample_prompts=\"<prompt file>\": Specifies a file (.txt, .toml, .json) containing prompts for sample image generation.
  • --sample_sampler=\"...\": Specifies the sampler (scheduler) for sample image generation. euler_a, dpm++_2m_karras, etc., are common. See --help for choices.

Format of Prompt File

A prompt file can contain multiple prompts with options, for example:

# prompt 1
masterpiece, best quality, (1girl), in white shirts, upper body, looking at viewer, simple background --n low quality, worst quality, bad anatomy,bad composition, poor, low effort --w 768 --h 768 --d 1 --l 7.5 --s 28

# prompt 2
masterpiece, best quality, 1boy, in business suit, standing at street, looking back --n (low quality, worst quality), bad anatomy,bad composition, poor, low effort --w 576 --h 832 --d 2 --l 5.5 --s 40

Lines beginning with # are comments. You can specify options for the generated image with options like --n after the prompt. The following can be used.

  • --n Negative prompt up to the next option. Ignored when CFG scale is 1.0.
  • --w Specifies the width of the generated image.
  • --h Specifies the height of the generated image.
  • --d Specifies the seed of the generated image.
  • --l Specifies the CFG scale of the generated image. For FLUX.1 models, the default is 1.0, which means no CFG. For Chroma models, set to around 4.0 to enable CFG.
  • --g Specifies the embedded guidance scale for the models with embedded guidance (FLUX.1), the default is 3.5. Set to 0.0 for Chroma models.
  • --s Specifies the number of steps in the generation.

The prompt weighting such as ( ) and [ ] are working for SD/SDXL models, not working for other models like FLUX.1.

1.8. Logging & Tracking

  • --logging_dir=\"<log directory>\": Specifies the directory for TensorBoard and other logs. If not specified, logs are not output.
  • --log_with=\"tensorboard\" / \"wandb\" / \"all\": Specifies the logging tool to use. If using wandb, pip install wandb is required.
  • --log_prefix=\"<prefix>\": Specifies the prefix for subdirectory names created within logging_dir.
  • --wandb_api_key=\"<API key>\" / --wandb_run_name=\"<run name>\": Options for Weights & Biases (wandb).
  • --log_tracker_name / --log_tracker_config: Advanced tracker configuration options. Usually not needed.
  • --log_config: Logs the training configuration used (excluding some sensitive information) at the start of training. Helps ensure reproducibility.

1.9. Regularization and Advanced Techniques

  • --noise_offset=N: Enables noise offset and specifies its value. Expected to improve bias in image brightness and contrast. Recommended to enable as SDXL base models are trained with this (e.g., 0.0357). Original technical explanation here.
  • --noise_offset_random_strength: Randomly varies noise offset strength between 0 and the specified value.
  • --adaptive_noise_scale=N: Adjusts noise offset based on the mean absolute value of latents. Used with --noise_offset.
  • --multires_noise_iterations=N / --multires_noise_discount=D: Enables multi-resolution noise. Adding noise of different frequency components is expected to improve detail reproduction. Specify iteration count N (around 6-10) and discount rate D (around 0.3). Technical explanation here.
  • --ip_noise_gamma=G / --ip_noise_gamma_random_strength: Enables Input Perturbation Noise. Adds small noise to input (latents) for regularization. Specify Gamma value (around 0.1). Strength can be randomized with random_strength.
  • --min_snr_gamma=N: Applies Min-SNR Weighting Strategy. Adjusts loss weights for timesteps with high noise in early training to stabilize learning. N=5 etc. are used.
  • --scale_v_pred_loss_like_noise_pred: In v-prediction models, scales v-prediction loss similarly to noise prediction loss. Not typically used for SDXL as it's not a v-prediction model.
  • --v_pred_like_loss=N: Adds v-prediction-like loss to noise prediction models. N specifies its weight. Not typically used for SDXL.
  • --debiased_estimation_loss: Calculates loss using Debiased Estimation. Similar purpose to Min-SNR but a different approach.
  • --loss_type=\"l1\" / \"l2\" / \"huber\" / \"smooth_l1\": Specifies the loss function. Default is l2 (MSE). huber and smooth_l1 are robust to outliers.
  • --huber_schedule=\"constant\" / \"exponential\" / \"snr\": Scheduling method when using huber or smooth_l1 loss. snr is recommended.
  • --huber_c=C / --huber_scale=S: Parameters for huber or smooth_l1 loss.
  • --masked_loss: Limits loss calculation area based on a mask image. Requires specifying mask images (black and white) in conditioning_data_dir in dataset settings. See About Masked Loss for details.

1.10. Distributed Training and Other Training Related Options

  • --seed=N: Specifies the random seed. Set this to ensure training reproducibility.
  • --max_token_length=N (75, 150, 225): Maximum token length processed by Text Encoders. For SDXL, typically 75 (default), 150, or 225. Longer lengths can handle more complex prompts but increase VRAM usage.
  • --clip_skip=N: Uses the output from N layers skipped from the final layer of Text Encoders. Not typically used for SDXL.
  • --lowram / --highvram: Options for memory usage optimization. --lowram is for environments like Colab where RAM < VRAM, --highvram is for environments with ample VRAM.
  • --persistent_data_loader_workers / --max_data_loader_n_workers=N: Settings for DataLoader worker processes. Affects wait time between epochs and memory usage.
  • --config_file="<config file>" / --output_config: Options to use/output a .toml file instead of command line arguments.
  • Accelerate/DeepSpeed related: (--ddp_timeout, --ddp_gradient_as_bucket_view, --ddp_static_graph): Detailed settings for distributed training. Accelerate settings (accelerate config) are usually sufficient. DeepSpeed requires separate configuration.
  • --initial_epoch=<integer> – Sets the initial epoch number. 1 means first epoch (same as not specifying). Note: initial_epoch/initial_step doesn't affect the lr scheduler, which means lr scheduler will start from 0 without --resume.
  • --initial_step=<integer> – Sets the initial step number including all epochs. 0 means first step (same as not specifying). Overwrites initial_epoch.
  • --skip_until_initial_step – Skips training until initial_step is reached.

1.11. Console and Logging / コン゜ヌルずログ

  • --console_log_level: Sets the logging level for the console output. Choose from DEBUG, INFO, WARNING, ERROR, CRITICAL.
  • --console_log_file: Redirects console logs to a specified file.
  • --console_log_simple: Enables a simpler log format.

1.12. Hugging Face Hub Integration / Hugging Face Hub 連携

  • --huggingface_repo_id: The repository name on Hugging Face Hub to upload the model to (e.g., your-username/your-model).
  • --huggingface_repo_type: The type of repository on Hugging Face Hub. Usually model.
  • --huggingface_path_in_repo: The path within the repository to upload files to.
  • --huggingface_token: Your Hugging Face Hub authentication token.
  • --huggingface_repo_visibility: Sets the visibility of the repository (public or private).
  • --resume_from_huggingface: Resumes training from a state saved on Hugging Face Hub.
  • --async_upload: Enables asynchronous uploading of models to the Hub, preventing it from blocking the training process.
  • --save_n_epoch_ratio: Saves the model at a certain ratio of total epochs. For example, 5 will save at least 5 checkpoints throughout the training.

1.13. Advanced Attention Settings / 高床なAttention蚭定

  • --mem_eff_attn: Use memory-efficient attention mechanism. This is an older implementation and sdpa or xformers are generally recommended.
  • --xformers: Use xformers library for memory-efficient attention. Requires pip install xformers.

1.14. Advanced LR Scheduler Settings / 高床な孊習率スケゞュヌラ蚭定

  • --lr_scheduler_type: Specifies a custom scheduler module.
  • --lr_scheduler_args: Provides additional arguments to the custom scheduler (e.g., "T_max=100").
  • --lr_decay_steps: Sets the number of steps for the learning rate to decay.
  • --lr_scheduler_timescale: The timescale for the inverse square root scheduler.
  • --lr_scheduler_min_lr_ratio: Sets the minimum learning rate as a ratio of the initial learning rate for certain schedulers.

1.15. Differential Learning with LoRA / LoRAの差分孊習

This technique involves merging a pre-trained LoRA into the base model before starting a new training session. This is useful for fine-tuning an existing LoRA or for learning the 'difference' from it.

  • --base_weights: Path to one or more LoRA weight files to be merged into the base model before training begins.
  • --base_weights_multiplier: A multiplier for the weights of the LoRA specified by --base_weights. You can specify multiple values if you provide multiple weights.

1.16. Other Miscellaneous Options / その他のオプション

  • --tokenizer_cache_dir: Specifies a directory to cache the tokenizer, which is useful for offline training.
  • --scale_weight_norms: Scales the weight norms of the LoRA modules. This can help prevent overfitting by controlling the magnitude of the weights. A value of 1.0 is a good starting point.
  • --disable_mmap_load_safetensors: Disables memory-mapped loading for .safetensors files. This can speed up model loading in some environments like WSL.

2. Other Tips / その他のTips

  • VRAM Usage: SDXL LoRA training requires a lot of VRAM. Even with 24GB VRAM, you might run out of memory depending on settings. Reduce VRAM usage with these settings:
    • --mixed_precision=\"bf16\" or \"fp16\" (essential)
    • --gradient_checkpointing (strongly recommended)
    • --cache_latents / --cache_text_encoder_outputs (highly effective, with limitations)
    • --optimizer_type=\"AdamW8bit\" or \"Adafactor\"
    • Increase --gradient_accumulation_steps (reduce batch size)
    • --full_fp16 / --full_bf16 (be mindful of stability)
    • --fp8_base / --fp8_base_unet (experimental)
    • --fused_backward_pass (Adafactor only, experimental)
  • Learning Rate: Appropriate learning rates for SDXL LoRA depend on the dataset and network_dim/alpha. Starting around 1e-4 ~ 4e-5 (U-Net), 1e-5 ~ 2e-5 (Text Encoders) is common.
  • Training Time: Training takes time due to high-resolution data and the size of the SDXL model. Using caching features and appropriate hardware is important.
  • Troubleshooting:
    • NaN Loss: Learning rate might be too high, mixed precision settings incorrect (e.g., --no_half_vae not specified with fp16), or dataset issues.
    • Out of Memory (OOM): Try the VRAM reduction measures listed above.
    • Training not progressing: Learning rate might be too low, optimizer/scheduler settings incorrect, or dataset issues.

3. Conclusion / おわりに

sdxl_train_network.py offers many options to customize SDXL LoRA training. Refer to --help, other documents and the source code for further details.

日本語

高床な蚭定: SDXL LoRA孊習スクリプト sdxl_train_network.py 詳现ガむド

このドキュメントでは、sd-scripts リポゞトリに含たれる sdxl_train_network.py を䜿甚した、SDXL (Stable Diffusion XL) モデルに察する LoRA (Low-Rank Adaptation) モデル孊習の高床な蚭定オプションに぀いお解説したす。

基本的な䜿い方に぀いおは、以䞋のドキュメントを参照しおください。

このガむドは、基本的なLoRA孊習の経隓があり、より詳现な蚭定や高床な機胜を詊したい熟緎した利甚者を察象ずしおいたす。

前提条件:

  • sd-scripts リポゞトリのクロヌンず Python 環境のセットアップが完了しおいるこず。
  • 孊習甚デヌタセットの準備ず蚭定.tomlファむルが完了しおいるこず。デヌタセット蚭定ガむド参照
  • 基本的なLoRA孊習のコマンドラむン実行経隓があるこず。

1. コマンドラむン匕数 詳现解説

sdxl_train_network.py は train_network.py の機胜を継承し぀぀、SDXL特有の機胜を远加しおいたす。ここでは、SDXL LoRA孊習に関連する䞻芁なコマンドラむン匕数に぀いお、機胜別に分類しお詳现に解説したす。

基本的な匕数に぀いおは、LoRA孊習スクリプト train_network.py の䜿い方 および SDXL LoRA孊習スクリプト sdxl_train_network.py の䜿い方 を参照しおください。

1.1. モデル読み蟌み関連

  • --pretrained_model_name_or_path="<モデルパス>" [必須]
    • 孊習のベヌスずなる SDXLモデル を指定したす。Hugging Face HubのモデルID、ロヌカルのDiffusers圢匏モデルディレクトリ、たたは.safetensorsファむルを指定できたす。
    • 詳现は基本ガむドを参照しおください。
  • --vae="<VAEパス>"
    • オプションで、孊習に䜿甚するVAEを指定したす。SDXLモデルに含たれるVAE以倖を䜿甚する堎合に指定したす。.ckptたたは.safetensorsファむルを指定できたす。
  • --no_half_vae
    • 混合粟床(fp16/bf16)䜿甚時でもVAEをfloat32で動䜜させたす。SDXLのVAEはfloat16で䞍安定になるこずがあるため、fp16指定時には有効にするこずが掚奚されたす。bf16では通垞䞍芁です。
  • --fp8_base / --fp8_base_unet
    • 実隓的機胜: ベヌスモデルU-Net, Text EncoderたたはU-NetのみをFP8で読み蟌み、VRAM䜿甚量を削枛したす。PyTorch 2.1以䞊が必芁です。詳现は TODO 埌でドキュメントを远加 の関連セクションを参照しおください (SD3の説明ですがSDXLにも適甚されたす)。

1.2. デヌタセット蚭定関連

  • --dataset_config="<蚭定ファむルのパス>"
    • デヌタセットの蚭定を蚘述した.tomlファむルを指定したす。SDXLでは高解像床デヌタずバケツ機胜.toml で enable_bucket = true を指定の利甚が䞀般的です。
    • .tomlファむルの曞き方の詳现はデヌタセット蚭定ガむドを参照しおください。
    • アスペクト比バケツの解像床ステップ(bucket_reso_steps)は、SDXLでは32の倍数ずする必芁がありたす。

1.3. 出力・保存関連

基本的なオプションは train_network.py ず共通です。

  • --output_dir="<出力先ディレクトリ>" [必須]
  • --output_name="<出力ファむル名>" [必須]
  • --save_model_as="safetensors" (掚奚), ckpt, pt, diffusers, diffusers_safetensors
  • --save_precision="fp16", "bf16", "float"
    • モデルの保存粟床を指定したす。未指定時は孊習時の粟床(fp16, bf16等)で保存されたす。
  • --save_every_n_epochs=N / --save_every_n_steps=N
    • N゚ポック/ステップごずにモデルを保存したす。
  • --save_last_n_epochs=M / --save_last_n_steps=M
    • ゚ポック/ステップごずに保存する際、最新のM個のみを保持し、叀いものは削陀したす。
  • --save_state / --save_state_on_train_end
    • モデル保存時/孊習終了時に、Optimizerの状態などを含む孊習状態(state)を保存したす。--resumeオプションでの孊習再開に必芁です。
  • --save_last_n_epochs_state=M / --save_last_n_steps_state=M
    • stateの保存数をM個に制限したす。--save_last_n_epochs/stepsの指定を䞊曞きしたす。
  • --no_metadata
    • 出力モデルにメタデヌタを保存したせん。
  • --save_state_to_huggingface / --huggingface_repo_id など
    • Hugging Face Hubぞのモデルやstateのアップロヌド関連オプション。詳现は TODO ドキュメントを远加 を参照しおください。

1.4. ネットワヌクパラメヌタ (LoRA)

基本的なオプションは train_network.py ず共通です。

  • --network_module=networks.lora [必須]
  • --network_dim=N [必須]
    • LoRAのランク (次元数) を指定したす。SDXLでは32や64などが詊されるこずが倚いですが、デヌタセットや目的に応じお調敎が必芁です。
  • --network_alpha=M
    • LoRAのアルファ倀。network_dimの半分皋床、たたはnetwork_dimず同じ倀などが䞀般的です。デフォルトは1。
  • --network_dropout=P
    • LoRAモゞュヌル内のドロップアりト率 (0.0~1.0)。過孊習抑制の効果が期埅できたす。デフォルトはNone (ドロップアりトなし)。
  • --network_args ...
    • ネットワヌクモゞュヌルぞの远加匕数を key=value 圢匏で指定したす。LoRAでは以䞋の高床な蚭定が可胜です。
      • 階局別 (Block-wise) 次元数/アルファ:
        • U-Netの各ブロックごずに異なるdimずalphaを指定できたす。これにより、特定の局の圱響を匷めたり匱めたりする調敎が可胜です。
        • block_dims: U-NetのLinear局およびConv2d 1x1局に察するブロックごずのdimをカンマ区切りで指定したす (SDXLでは23個の数倀)。
        • block_alphas: 䞊蚘に察応するalpha倀をカンマ区切りで指定したす。
        • conv_block_dims: U-NetのConv2d 3x3局に察するブロックごずのdimをカンマ区切りで指定したす。
        • conv_block_alphas: 䞊蚘に察応するalpha倀をカンマ区切りで指定したす。
        • 指定しないブロックは --network_dim/--network_alpha たたは --conv_dim/--conv_alpha (存圚する堎合) の倀が䜿甚されたす。
        • 詳现はLoRA の階局別孊習率 (train_network.md内、SDXLでも同様に適甚可胜) や実装 (lora.py) を参照しおください。
      • LoRA+:
        • loraplus_lr_ratio=R: LoRAの䞊向き重み(UP)の孊習率を、䞋向き重み(DOWN)の孊習率のR倍にしたす。孊習速床の向䞊が期埅できたす。論文掚奚は16。
        • loraplus_unet_lr_ratio=RU: U-Net郚分のLoRA+孊習率比を個別に指定したす。
        • loraplus_text_encoder_lr_ratio=RT: Text Encoder郚分のLoRA+孊習率比を個別に指定したす。(--text_encoder_lr1, --text_encoder_lr2で指定した孊習率に乗算されたす)
        • 詳现はREADMEや実装 (lora.py) を参照しおください。
  • --network_train_unet_only
    • U-NetのLoRAモゞュヌルのみを孊習したす。Text Encoderの孊習を行わない堎合に指定したす。--cache_text_encoder_outputs を䜿甚する堎合は必須です。
  • --network_train_text_encoder_only
    • Text EncoderのLoRAモゞュヌルのみを孊習したす。U-Netの孊習を行わない堎合に指定したす。
  • --network_weights="<重みファむル>"
    • 孊習枈みのLoRA重みを読み蟌んで孊習を開始したす。ファむンチュヌニングや孊習再開に䜿甚したす。--resume ずの違いは、このオプションはLoRAモゞュヌルの重みのみを読み蟌み、--resume はOptimizerの状態や孊習ステップ数なども埩元したす。
  • --dim_from_weights
    • --network_weights で指定した重みファむルからLoRAの次元数 (dim) を自動的に読み蟌みたす。--network_dim の指定は䞍芁になりたす。

1.5. 孊習パラメヌタ

  • --learning_rate=LR
    • 党䜓の孊習率。各モゞュヌル(unet_lr, text_encoder_lr1, text_encoder_lr2)のデフォルト倀ずなりたす。1e-3 や 1e-4 などが詊されるこずが倚いです。
  • --unet_lr=LR_U
    • U-Net郚分のLoRAモゞュヌルの孊習率。
  • --text_encoder_lr1=LR_TE1
    • Text Encoder 1 (OpenCLIP ViT-G/14) のLoRAモゞュヌルの孊習率。通垞、U-Netより小さい倀 (䟋: 1e-5, 2e-5) が掚奚されたす。
  • --text_encoder_lr2=LR_TE2
    • Text Encoder 2 (CLIP ViT-L/14) のLoRAモゞュヌルの孊習率。通垞、U-Netより小さい倀 (䟋: 1e-5, 2e-5) が掚奚されたす。
  • --optimizer_type="..."
    • 䜿甚するOptimizerを指定したす。AdamW8bit (省メモリ、䞀般的), Adafactor (さらに省メモリ、SDXLフルモデル孊習で実瞟あり), Lion, DAdaptation, Prodigyなどが遞択可胜です。各Optimizerには远加の匕数が必芁な堎合がありたす (--optimizer_args参照)。
    • AdamW8bit や PagedAdamW8bit (芁 bitsandbytes) が䞀般的です。
    • Adafactor はメモリ効率が良いですが、蚭定がやや耇雑です (盞察ステップ(relative_step=True)掚奚、孊習率スケゞュヌラはadafactor掚奚)。
    • DAdaptation, Prodigy は孊習率の自動調敎機胜がありたすが、LoRA+ずの䜵甚はできたせん。孊習率は1.0皋床を指定したす。
    • 詳现はtrain_util.pyのget_optimizer関数を参照しおください。
  • --optimizer_args ...
    • Optimizerぞの远加匕数を key=value 圢匏で指定したす (䟋: "weight_decay=0.01" "betas=0.9,0.999").
  • --lr_scheduler="..."
    • 孊習率スケゞュヌラを指定したす。constant (倉化なし), cosine (コサむンカヌブ), linear (線圢枛衰), constant_with_warmup (りォヌムアップ付き定数), cosine_with_restarts など。constant や cosine 、 constant_with_warmup がよく䜿われたす。
    • スケゞュヌラによっおは远加の匕数が必芁です (--lr_scheduler_args参照)。
    • DAdaptation や Prodigy などの自己孊習率調敎機胜付きOptimizerを䜿甚する堎合、スケゞュヌラは䞍芁です (constant を指定)。
  • --lr_warmup_steps=N
    • 孊習率スケゞュヌラのりォヌムアップステップ数。孊習開始時に孊習率を埐々に䞊げおいく期間です。N < 1 の堎合は党ステップ数に察する割合ず解釈されたす。
  • --lr_scheduler_num_cycles=N / --lr_scheduler_power=P
    • 特定のスケゞュヌラ (cosine_with_restarts, polynomial) のためのパラメヌタ。
  • --max_train_steps=N / --max_train_epochs=N
    • 孊習の総ステップ数たたぱポック数を指定したす。゚ポック指定が優先されたす。
  • --mixed_precision="bf16" / "fp16" / "no"
    • 混合粟床孊習の蚭定。SDXLでは bf16 (察応GPUの堎合) たたは fp16 の䜿甚が匷く掚奚されたす。VRAM䜿甚量を削枛し、孊習速床を向䞊させたす。
  • --full_fp16 / --full_bf16
    • 募配蚈算も含めお完党に半粟床/bf16で行いたす。VRAM䜿甚量をさらに削枛できたすが、孊習の安定性に圱響する可胜性がありたす。VRAMがどうしおも足りない堎合に䜿甚したす。
  • --gradient_accumulation_steps=N
    • 募配をNステップ分蓄積しおからOptimizerを曎新したす。実質的なバッチサむズを train_batch_size * N に増やし、少ないVRAMで倧きなバッチサむズ盞圓の効果を埗られたす。デフォルトは1。
  • --max_grad_norm=N
    • 募配クリッピングの閟倀。募配のノルムがNを超える堎合にクリッピングしたす。デフォルトは1.0。0で無効。
  • --gradient_checkpointing
    • メモリ䜿甚量を倧幅に削枛したすが、孊習速床は若干䜎䞋したす。SDXLではメモリ消費が倧きいため、有効にするこずが掚奚されたす。
  • --fused_backward_pass
    • 実隓的機胜: 募配蚈算ずOptimizerのステップを融合し、VRAM䜿甚量を削枛したす。SDXLで利甚可胜です。珟圚 Adafactor Optimizerのみ察応。Gradient Accumulationずは䜵甚できたせん。
  • --resume="<stateディレクトリ>"
    • --save_stateで保存された孊習状態から孊習を再開したす。Optimizerの状態や孊習ステップ数などが埩元されたす。

1.6. キャッシュ機胜関連

SDXLは蚈算コストが高いため、キャッシュ機胜が効果的です。

  • --cache_latents
    • VAEの出力(Latent)をメモリにキャッシュしたす。VAEの蚈算を省略でき、VRAM䜿甚量を削枛し、孊習を高速化したす。泚意: 画像に察するAugmentation (color_aug, flip_aug, random_crop 等) は無効になりたす。
  • --cache_latents_to_disk
    • --cache_latents ず䜵甚し、キャッシュ先をディスクにしたす。倧量のデヌタセットや耇数回の孊習で特に有効です。初回実行時にディスクにキャッシュが生成され、2回目以降はそれを読み蟌みたす。
  • --cache_text_encoder_outputs
    • Text Encoderの出力をメモリにキャッシュしたす。Text Encoderの蚈算を省略でき、VRAM䜿甚量を削枛し、孊習を高速化したす。泚意: キャプションに察するAugmentation (shuffle_caption, caption_dropout_rate 等) は無効になりたす。たた、このオプションを䜿甚する堎合、Text EncoderのLoRAモゞュヌルは孊習できたせん (--network_train_unet_only の指定が必須です)。
  • --cache_text_encoder_outputs_to_disk
    • --cache_text_encoder_outputs ず䜵甚し、キャッシュ先をディスクにしたす。
  • --skip_cache_check
    • キャッシュファむルの内容の怜蚌をスキップしたす。ファむルの存圚確認は行われ、存圚しない堎合はキャッシュが生成されたす。デバッグ等で意図的に再キャッシュしたい堎合を陀き、通垞は指定䞍芁です。

1.7. サンプル画像生成関連

基本的なオプションは train_network.py ず共通です。

  • --sample_every_n_steps=N / --sample_every_n_epochs=N
    • Nステップ/゚ポックごずにサンプル画像を生成したす。
  • --sample_at_first
    • 孊習開始前にサンプル画像を生成したす。
  • --sample_prompts="<プロンプトファむル>"
    • サンプル画像生成に䜿甚するプロンプトを蚘述したファむル (.txt, .toml, .json) を指定したす。
  • --sample_sampler="..."
    • サンプル画像生成時のサンプラヌスケゞュヌラを指定したす。euler_a, dpm++_2m_karras などが䞀般的です。遞択肢は --help を参照しおください。

プロンプトファむルの曞匏

プロンプトファむルは耇数のプロンプトずオプションを含めるこずができたす。䟋えば

# prompt 1
masterpiece, best quality, (1girl), in white shirts, upper body, looking at viewer, simple background --n low quality, worst quality, bad anatomy,bad composition, poor, low effort --w 768 --h 768 --d 1 --l 7.5 --s 28

# prompt 2
masterpiece, best quality, 1boy, in business suit, standing at street, looking back --n (low quality, worst quality), bad anatomy,bad composition, poor, low effort --w 576 --h 832 --d 2 --l 5.5 --s 40

#で始たる行はコメントです。生成画像のオプションはプロンプトの埌に --n のように指定できたす。以䞋のオプションが䜿甚可胜です。

  • --n 次のオプションたでがネガティブプロンプトです。CFGスケヌルが 1.0 の堎合は無芖されたす。
  • --w 生成画像の幅を指定したす。
  • --h 生成画像の高さを指定したす。
  • --d 生成画像のシヌド倀を指定したす。
  • --l 生成画像のCFGスケヌルを指定したす。FLUX.1モデルでは、デフォルトは 1.0 でCFGなしを意味したす。Chromaモデルでは、CFGを有効にするために 4.0 皋床に蚭定しおください。
  • --g 埋め蟌みガむダンス付きモデルFLUX.1の埋め蟌みガむダンススケヌルを指定、デフォルトは 3.5。Chromaモデルでは 0.0 に蚭定しおください。
  • --s 生成時のステップ数を指定したす。

プロンプトの重み付け ( ) や [ ] はSD/SDXLモデルで動䜜し、FLUX.1など他のモデルでは動䜜したせん。

1.8. Logging & Tracking 関連

  • --logging_dir="<ログディレクトリ>"
    • TensorBoardなどのログを出力するディレクトリを指定したす。指定しない堎合、ログは出力されたせん。
  • --log_with="tensorboard" / "wandb" / "all"
    • 䜿甚するログツヌルを指定したす。wandbを䜿甚する堎合、pip install wandbが必芁です。
  • --log_prefix="<プレフィックス>"
    • logging_dir 内に䜜成されるサブディレクトリ名の接頭蟞を指定したす。
  • --wandb_api_key="<APIキヌ>" / --wandb_run_name="<実行名>"
    • Weights & Biases (wandb) 䜿甚時のオプション。
  • --log_tracker_name / --log_tracker_config
    • 高床なトラッカヌ蚭定甚オプション。通垞は指定䞍芁。
  • --log_config
    • 孊習開始時に、䜿甚された孊習蚭定䞀郚の機密情報を陀くをログに出力したす。再珟性の確保に圹立ちたす。

1.9. 正則化・高床な孊習テクニック関連

  • --noise_offset=N
    • ノむズオフセットを有効にし、その倀を指定したす。画像の明るさやコントラストの偏りを改善する効果が期埅できたす。SDXLのベヌスモデルはこの倀で孊習されおいるため、有効にするこずが掚奚されたす (䟋: 0.0357)。元々の技術解説はこちら。
  • --noise_offset_random_strength
    • ノむズオフセットの匷床を0から指定倀の間でランダムに倉動させたす。
  • --adaptive_noise_scale=N
    • Latentの平均絶察倀に応じおノむズオフセットを調敎したす。--noise_offsetず䜵甚したす。
  • --multires_noise_iterations=N / --multires_noise_discount=D
    • 耇数解像床ノむズを有効にしたす。異なる呚波数成分のノむズを加えるこずで、ディテヌルの再珟性を向䞊させる効果が期埅できたす。むテレヌション回数N (6-10皋床) ず割匕率D (0.3皋床) を指定したす。技術解説はこちら。
  • --ip_noise_gamma=G / --ip_noise_gamma_random_strength
    • Input Perturbation Noiseを有効にしたす。入力(Latent)に埮小なノむズを加えお正則化を行いたす。Gamma倀 (0.1皋床) を指定したす。random_strengthで匷床をランダム化できたす。
  • --min_snr_gamma=N
    • Min-SNR Weighting Strategy を適甚したす。孊習初期のノむズが倧きいタむムステップでのLossの重みを調敎し、孊習を安定させたす。N=5 などが䜿甚されたす。
  • --scale_v_pred_loss_like_noise_pred
    • v-predictionモデルにおいお、vの予枬ロスをノむズ予枬ロスず同様のスケヌルに調敎したす。SDXLはv-predictionではないため、通垞は䜿甚したせん。
  • --v_pred_like_loss=N
    • ノむズ予枬モデルにv予枬ラむクなロスを远加したす。Nでその重みを指定したす。SDXLでは通垞は䜿甚したせん。
  • --debiased_estimation_loss
    • Debiased EstimationによるLoss蚈算を行いたす。Min-SNRず類䌌の目的を持ちたすが、異なるアプロヌチです。
  • --loss_type="l1" / "l2" / "huber" / "smooth_l1"
    • 損倱関数を指定したす。デフォルトはl2 (MSE)。huberやsmooth_l1は倖れ倀に頑健な損倱関数です。
  • --huber_schedule="constant" / "exponential" / "snr"
    • huberたたはsmooth_l1損倱䜿甚時のスケゞュヌリング方法。snrが掚奚されおいたす。
  • --huber_c=C / --huber_scale=S
    • huberたたはsmooth_l1損倱のパラメヌタ。
  • --masked_loss
    • マスク画像に基づいおLoss蚈算領域を限定したす。デヌタセット蚭定でconditioning_data_dirにマスク画像癜黒を指定する必芁がありたす。詳现はマスクロスに぀いおを参照しおください。

1.10. 分散孊習、その他孊習関連

  • --seed=N
    • 乱数シヌドを指定したす。孊習の再珟性を確保したい堎合に蚭定したす。
  • --max_token_length=N (75, 150, 225)
    • Text Encoderが凊理するトヌクンの最倧長。SDXLでは通垞75 (デフォルト) たたは 150, 225。長くするずより耇雑なプロンプトを扱えたすが、VRAM䜿甚量が増加したす。
  • --clip_skip=N
    • Text Encoderの最終局からN局スキップした局の出力を䜿甚したす。SDXLでは通垞䜿甚したせん。
  • --lowram / --highvram
    • メモリ䜿甚量の最適化に関するオプション。--lowramはColabなどRAM < VRAM環境向け、--highvramはVRAM最沢な環境向け。
  • --persistent_data_loader_workers / --max_data_loader_n_workers=N
    • DataLoaderのワヌカプロセスに関する蚭定。゚ポック間の埅ち時間やメモリ䜿甚量に圱響したす。
  • --config_file="<蚭定ファむル>" / --output_config
    • コマンドラむン匕数の代わりに.tomlファむルを䜿甚/出力するオプション。
  • Accelerate/DeepSpeed関連: (--ddp_timeout, --ddp_gradient_as_bucket_view, --ddp_static_graph)
    • 分散孊習時の詳现蚭定。通垞はAccelerateの蚭定 (accelerate config) で十分です。DeepSpeedを䜿甚する堎合は、別途蚭定が必芁です。
  • --initial_epoch=<integer> – 開始゚ポック番号を蚭定したす。1で最初の゚ポック未指定時ず同じ。泚意initial_epoch/initial_stepはlr schedulerに圱響しないため、--resumeしない堎合はlr schedulerは0から始たりたす。
  • --initial_step=<integer> – 党゚ポックを含む開始ステップ番号を蚭定したす。0で最初のステップ未指定時ず同じ。initial_epochを䞊曞きしたす。
  • --skip_until_initial_step – initial_stepに到達するたで孊習をスキップしたす。

1.11. コン゜ヌルずログ

  • --console_log_level: コン゜ヌル出力のログレベルを蚭定したす。DEBUG, INFO, WARNING, ERROR, CRITICALから遞択したす。
  • --console_log_file: コン゜ヌルのログを指定されたファむルに出力したす。
  • --console_log_simple: よりシンプルなログフォヌマットを有効にしたす。

1.12. Hugging Face Hub 連携

  • --huggingface_repo_id: モデルをアップロヌドするHugging Face Hubのリポゞトリ名 (䟋: your-username/your-model)。
  • --huggingface_repo_type: Hugging Face Hubのリポゞトリの皮類。通垞はmodelです。
  • --huggingface_path_in_repo: リポゞトリ内でファむルをアップロヌドするパス。
  • --huggingface_token: Hugging Face Hubの認蚌トヌクン。
  • --huggingface_repo_visibility: リポゞトリの公開蚭定 (publicたたはprivate)。
  • --resume_from_huggingface: Hugging Face Hubに保存された状態から孊習を再開したす。
  • --async_upload: Hubぞのモデルの非同期アップロヌドを有効にし、孊習プロセスをブロックしないようにしたす。
  • --save_n_epoch_ratio: 総゚ポック数に察する特定の比率でモデルを保存したす。䟋えば5を指定するず、孊習党䜓で少なくずも5぀のチェックポむントが保存されたす。

1.13. 高床なAttention蚭定

  • --mem_eff_attn: メモリ効率の良いAttentionメカニズムを䜿甚したす。これは叀い実装であり、䞀般的にはsdpaやxformersの䜿甚が掚奚されたす。
  • --xformers: メモリ効率の良いAttentionのためにxformersラむブラリを䜿甚したす。pip install xformersが必芁です。

1.14. 高床な孊習率スケゞュヌラ蚭定

  • --lr_scheduler_type: カスタムスケゞュヌラモゞュヌルを指定したす。
  • --lr_scheduler_args: カスタムスケゞュヌラに远加の匕数を枡したす (䟋: "T_max=100")。
  • --lr_decay_steps: 孊習率が枛衰するステップ数を蚭定したす。
  • --lr_scheduler_timescale: 逆平方根スケゞュヌラのタむムスケヌル。
  • --lr_scheduler_min_lr_ratio: 特定のスケゞュヌラに぀いお、初期孊習率に察する最小孊習率の比率を蚭定したす。

1.15. LoRAの差分孊習

既存の孊習枈みLoRAをベヌスモデルにマヌゞしおから、新たな孊習を開始する手法です。既存LoRAのファむンチュヌニングや、差分を孊習させたい堎合に有効です。

  • --base_weights: 孊習開始前にベヌスモデルにマヌゞするLoRAの重みファむルを1぀以䞊指定したす。
  • --base_weights_multiplier: --base_weightsで指定したLoRAの重みの倍率。耇数指定も可胜です。

1.16. その他のオプション

  • --tokenizer_cache_dir: オフラむンでの孊習に䟿利なように、tokenizerをキャッシュするディレクトリを指定したす。
  • --scale_weight_norms: LoRAモゞュヌルの重みのノルムをスケヌリングしたす。重みの倧きさを制埡するこずで過孊習を防ぐ助けになりたす。1.0が良い出発点です。
  • --disable_mmap_load_safetensors: .safetensorsファむルのメモリマップドロヌディングを無効にしたす。WSLなどの䞀郚環境でモデルの読み蟌みを高速化できたす。

2. その他のTips

  • VRAM䜿甚量: SDXL LoRA孊習は倚くのVRAMを必芁ずしたす。24GB VRAMでも蚭定によっおはメモリ䞍足になるこずがありたす。以䞋の蚭定でVRAM䜿甚量を削枛できたす。
    • --mixed_precision="bf16" たたは "fp16" (必須玚)
    • --gradient_checkpointing (匷く掚奚)
    • --cache_latents / --cache_text_encoder_outputs (効果倧、制玄あり)
    • --optimizer_type="AdamW8bit" たたは "Adafactor"
    • --gradient_accumulation_steps の倀を増やす (バッチサむズを小さくする)
    • --full_fp16 / --full_bf16 (安定性に泚意)
    • --fp8_base / --fp8_base_unet (実隓的)
    • --fused_backward_pass (Adafactor限定、実隓的)
  • 孊習率: SDXL LoRAの適切な孊習率はデヌタセットやnetwork_dim/alphaに䟝存したす。1e-4 ~ 4e-5 (U-Net), 1e-5 ~ 2e-5 (Text Encoders) あたりから詊すのが䞀般的です。
  • 孊習時間: 高解像床デヌタずSDXLモデルのサむズのため、孊習には時間がかかりたす。キャッシュ機胜や適切なハヌドりェアの利甚が重芁です。
  • トラブルシュヌティング:
    • NaN Loss: 孊習率が高すぎる、混合粟床の蚭定が䞍適切 (fp16時の--no_half_vae未指定など)、デヌタセットの問題などが考えられたす。
    • VRAM䞍足 (OOM): 䞊蚘のVRAM削枛策を詊しおください。
    • 孊習が進たない: 孊習率が䜎すぎる、Optimizer/Schedulerの蚭定が䞍適切、デヌタセットの問題などが考えられたす。

3. おわりに

sdxl_train_network.py は非垞に倚くのオプションを提䟛しおおり、SDXL LoRA孊習の様々な偎面をカスタマむズできたす。このドキュメントが、より高床な蚭定やチュヌニングを行う際の助けずなれば幞いです。

䞍明な点や詳现に぀いおは、各スクリプトの --help オプションや、リポゞトリ内の他のドキュメント、実装コヌド自䜓を参照しおください。