[WAN 1.3B] LoRA
dataset.toml
# 解像度設定。
resolutions = [512]
# アスペクト比バケット設定
enable_ar_bucket = true
min_ar = 0.5
max_ar = 2.0
num_ar_buckets = 7
# フレームバケット(1は画像用)
frame_buckets = [1]
[[directory]] # IMAGES
# 画像と対応するキャプションファイルを含むディレクトリのパス。
path = '/mnt/d/huanvideo/training_data/images'
num_repeats = 5
resolutions = [720]
frame_buckets = [1] # 画像には1フレームを使用
[[directory]] # VIDEOS
# 動画と対応するキャプションファイルを含むディレクトリのパス。
path = '/mnt/d/huanvideo/training_data/videos'
num_repeats = 5
resolutions = [512]
frame_buckets = [30, 33, 38, 50, 56, 80]
config.toml
# データセット設定ファイル
output_dir = '/mnt/d/wan/training_output'
dataset = 'dataset.toml'
# 学習設定
epochs = 50
micro_batch_size_per_gpu = 1
pipeline_stages = 1
gradient_accumulation_steps = 4
gradient_clipping = 1.0
warmup_steps = 100
# 評価設定
eval_every_n_epochs = 5
eval_before_first_step = true
eval_micro_batch_size_per_gpu = 1
eval_gradient_accumulation_steps = 1
# その他の設定
save_every_n_epochs = 5
checkpoint_every_n_minutes = 30
activation_checkpointing = true
partition_method = 'parameters'
save_dtype = 'bfloat16'
caching_batch_size = 1
steps_per_print = 1
video_clip_mode = 'single_middle'
[model]
type = 'wan'
ckpt_path = '../Wan2.1-T2V-1.3B'
dtype = 'bfloat16'
# LoRA学習時はトランスフォーマーにfp8を使用できます。
transformer_dtype = 'float8'
timestep_sample_method = 'logit_normal'
[adapter]
type = 'lora'
rank = 32
dtype = 'bfloat16'
[optimizer]
type = 'adamw_optimi'
lr = 5e-5
betas = [0.9, 0.99]
weight_decay = 0.02
eps = 1e-8