https://github.com/tdrussell/diffusion-pipe를 사용하여 학습됨
학습 데이터는 다음을 결합한 것으로 구성됩니다:
학습 설정:
dataset.toml
# 종횡비 버킷 설정
enable_ar_bucket = true
min_ar = 0.5
max_ar = 2.0
num_ar_buckets = 7
[[directory]] # 이미지
# 이미지 및 해당 캡션 파일이 포함된 디렉터리 경로
path = '/mnt/d/huanvideo/training_data/images'
num_repeats = 5
resolutions = [1024]
frame_buckets = [1] # 이미지에는 1프레임 사용
[[directory]] # 비디오
# 비디오 및 해당 캡션 파일이 포함된 디렉터리 경로
path = '/mnt/d/huanvideo/training_data/videos'
num_repeats = 5
resolutions = [368] # 비디오 해상도를 256(예: 244p)로 설정
frame_buckets = [33, 49, 81] # 비디오에 대한 프레임 버킷 정의
config.toml
# 데이터셋 구성 파일
output_dir = '/mnt/d/huanvideo/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 = 15
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 = 'hunyuan-video'
transformer_path = '/mnt/d/huanvideo/models/diffusion_models/hunyuan_video_720_cfgdistill_fp8_e4m3fn.safetensors'
vae_path = '/mnt/d/huanvideo/models/vae/hunyuan_video_vae_bf16.safetensors'
llm_path = '/mnt/d/huanvideo/models/llm'
clip_path = '/mnt/d/huanvideo/models/clip'
dtype = 'bfloat16'
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