Upload 2 files
Browse files- dataset.toml +47 -0
- hunyuan_video.toml +112 -0
dataset.toml
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Resolutions to train on, given as the side length of a square image. You can have multiple sizes here.
|
| 2 |
+
resolutions = [1024]
|
| 3 |
+
# You can give resolutions as (width, height) pairs also. This doesn't do anything different, it's just
|
| 4 |
+
# another way of specifying the area (i.e. total number of pixels) you want to train on.
|
| 5 |
+
# resolutions = [[1280, 720]]
|
| 6 |
+
|
| 7 |
+
# Enable aspect ratio bucketing. For the different AR buckets, the final size will be such that
|
| 8 |
+
# the areas match the resolutions you configured above.
|
| 9 |
+
enable_ar_bucket = true
|
| 10 |
+
|
| 11 |
+
# The aspect ratio and frame bucket settings may be specified for each [[directory]] entry as well.
|
| 12 |
+
# Directory-level settings will override top-level settings.
|
| 13 |
+
|
| 14 |
+
# Min and max aspect ratios, given as width/height ratio.
|
| 15 |
+
min_ar = 0.5
|
| 16 |
+
max_ar = 2.0
|
| 17 |
+
# Total number of aspect ratio buckets, evenly spaced (in log space) between min_ar and max_ar.
|
| 18 |
+
num_ar_buckets = 7
|
| 19 |
+
|
| 20 |
+
# Can manually specify ar_buckets instead of using the range-style config above.
|
| 21 |
+
# Each entry can be width/height ratio, or (width, height) pair. But you can't mix them, because of TOML.
|
| 22 |
+
# ar_buckets = [[512, 512], [448, 576]]
|
| 23 |
+
# ar_buckets = [1.0, 1.5]
|
| 24 |
+
|
| 25 |
+
# For video training, you need to configure frame buckets (similar to aspect ratio buckets). There will always
|
| 26 |
+
# be a frame bucket of 1 for images. Videos will be assigned to the first frame bucket that the video is greater than or equal to in length.
|
| 27 |
+
# But videos are never assigned to the image frame bucket (1); if the video is very short it would just be dropped.
|
| 28 |
+
frame_buckets = [1, 33, 65]
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
[[directory]]
|
| 32 |
+
# Path to directory of images/videos, and corresponding caption files. The caption files should match the media file name, but with a .txt extension.
|
| 33 |
+
# A missing caption file will log a warning, but then just train using an empty caption.
|
| 34 |
+
path = '/diffusion-pipe/input'
|
| 35 |
+
# The dataset will act like it is duplicated this many times.
|
| 36 |
+
num_repeats = 10
|
| 37 |
+
# Example of overriding some settings, and using ar_buckets to directly specify ARs.
|
| 38 |
+
# ar_buckets = [[448, 576]]
|
| 39 |
+
# resolutions = [[448, 576]]
|
| 40 |
+
# frame_buckets = [1]
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
# You can list multiple directories.
|
| 44 |
+
|
| 45 |
+
# [[directory]]
|
| 46 |
+
# path = '/home/anon/data/images/something_else'
|
| 47 |
+
# num_repeats = 5
|
hunyuan_video.toml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Output path for training runs. Each training run makes a new directory in here.
|
| 2 |
+
output_dir = '/diffusion-pipe/output'
|
| 3 |
+
|
| 4 |
+
# Dataset config file.
|
| 5 |
+
dataset = 'examples/dataset.toml'
|
| 6 |
+
# You can have separate eval datasets. Give them a name for Tensorboard metrics.
|
| 7 |
+
# eval_datasets = [
|
| 8 |
+
# {name = 'something', config = 'path/to/eval_dataset.toml'},
|
| 9 |
+
# ]
|
| 10 |
+
|
| 11 |
+
# training settings
|
| 12 |
+
|
| 13 |
+
# I usually set this to a really high value because I don't know how long I want to train.
|
| 14 |
+
epochs = 50
|
| 15 |
+
# Batch size of a single forward/backward pass for one GPU.
|
| 16 |
+
micro_batch_size_per_gpu = 1
|
| 17 |
+
# Pipeline parallelism degree. A single instance of the model is divided across this many GPUs.
|
| 18 |
+
pipeline_stages = 1
|
| 19 |
+
# Number of micro-batches sent through the pipeline for each training step.
|
| 20 |
+
# If pipeline_stages > 1, a higher GAS means better GPU utilization due to smaller pipeline bubbles (where GPUs aren't overlapping computation).
|
| 21 |
+
gradient_accumulation_steps = 4
|
| 22 |
+
# Grad norm clipping.
|
| 23 |
+
gradient_clipping = 1.0
|
| 24 |
+
# Learning rate warmup.
|
| 25 |
+
warmup_steps = 100
|
| 26 |
+
|
| 27 |
+
# eval settings
|
| 28 |
+
|
| 29 |
+
eval_every_n_epochs = 1
|
| 30 |
+
eval_before_first_step = true
|
| 31 |
+
# Might want to set these lower for eval so that less images get dropped (eval dataset size is usually much smaller than training set).
|
| 32 |
+
# Each size bucket of images/videos is rounded down to the nearest multiple of the global batch size, so higher global batch size means
|
| 33 |
+
# more dropped images. Usually doesn't matter for training but the eval set is much smaller so it can matter.
|
| 34 |
+
eval_micro_batch_size_per_gpu = 1
|
| 35 |
+
eval_gradient_accumulation_steps = 1
|
| 36 |
+
|
| 37 |
+
# misc settings
|
| 38 |
+
|
| 39 |
+
# Probably want to set this a bit higher if you have a smaller dataset so you don't end up with a million saved models.
|
| 40 |
+
save_every_n_epochs = 2
|
| 41 |
+
# Can checkpoint the training state every n number of epochs or minutes. Set only one of these. You can resume from checkpoints using the --resume_from_checkpoint flag.
|
| 42 |
+
#checkpoint_every_n_epochs = 1
|
| 43 |
+
checkpoint_every_n_minutes = 120
|
| 44 |
+
# Always set to true unless you have a huge amount of VRAM.
|
| 45 |
+
activation_checkpointing = true
|
| 46 |
+
# Controls how Deepspeed decides how to divide layers across GPUs. Probably don't change this.
|
| 47 |
+
partition_method = 'parameters'
|
| 48 |
+
# dtype for saving the LoRA or model, if different from training dtype
|
| 49 |
+
save_dtype = 'bfloat16'
|
| 50 |
+
# Batch size for caching latents and text embeddings. Increasing can lead to higher GPU utilization during caching phase but uses more memory.
|
| 51 |
+
caching_batch_size = 1
|
| 52 |
+
# How often deepspeed logs to console.
|
| 53 |
+
steps_per_print = 1
|
| 54 |
+
# How to extract video clips for training from a single input video file.
|
| 55 |
+
# The video file is first assigned to one of the configured frame buckets, but then we must extract one or more clips of exactly the right
|
| 56 |
+
# number of frames for that bucket.
|
| 57 |
+
# single_beginning: one clip starting at the beginning of the video
|
| 58 |
+
# single_middle: one clip from the middle of the video (cutting off the start and end equally)
|
| 59 |
+
# multiple_overlapping: extract the minimum number of clips to cover the full range of the video. They might overlap some.
|
| 60 |
+
# default is single_middle
|
| 61 |
+
video_clip_mode = 'single_middle'
|
| 62 |
+
|
| 63 |
+
[model]
|
| 64 |
+
# flux, ltx-video, or hunyuan-video
|
| 65 |
+
type = 'hunyuan-video'
|
| 66 |
+
# Can load Hunyuan Video entirely from the ckpt path set up for the official inference scripts.
|
| 67 |
+
#ckpt_path = '/home/anon/HunyuanVideo/ckpts'
|
| 68 |
+
# Or you can load it by pointing to all the ComfyUI files.
|
| 69 |
+
transformer_path = '/diffusion-pipe/models/hunyuan/hunyuan_video_720_cfgdistill_fp8_e4m3fn.safetensors'
|
| 70 |
+
vae_path = '/diffusion-pipe/models/hunyuan/hunyuan_video_vae_bf16.safetensors'
|
| 71 |
+
llm_path = '/diffusion-pipe/models/llm'
|
| 72 |
+
clip_path = '/diffusion-pipe/models/clip'
|
| 73 |
+
# Base dtype used for all models.
|
| 74 |
+
dtype = 'bfloat16'
|
| 75 |
+
# Hunyuan Video supports fp8 for the transformer when training LoRA.
|
| 76 |
+
transformer_dtype = 'float8'
|
| 77 |
+
# How to sample timesteps to train on. Can be logit_normal or uniform.
|
| 78 |
+
timestep_sample_method = 'logit_normal'
|
| 79 |
+
|
| 80 |
+
# flux example
|
| 81 |
+
# [model]
|
| 82 |
+
# type = 'flux'
|
| 83 |
+
# # Path to Huggingface Diffusers directory for Flux
|
| 84 |
+
# diffusers_path = '/data2/imagegen_models/FLUX.1-dev'
|
| 85 |
+
# # You can override the transformer from a BFL format checkpoint.
|
| 86 |
+
# transformer_path = '/data2/imagegen_models/flux-dev-single-files/consolidated_s6700-schnell.safetensors'
|
| 87 |
+
# dtype = 'bfloat16'
|
| 88 |
+
# flux_shift = true
|
| 89 |
+
|
| 90 |
+
# LTV-Video example
|
| 91 |
+
# [model]
|
| 92 |
+
# type = 'ltx-video'
|
| 93 |
+
# diffusers_path = '/data2/imagegen_models/LTX-Video'
|
| 94 |
+
# dtype = 'bfloat16'
|
| 95 |
+
# timestep_sample_method = 'logit_normal'
|
| 96 |
+
|
| 97 |
+
[adapter]
|
| 98 |
+
type = 'lora'
|
| 99 |
+
rank = 32
|
| 100 |
+
# Dtype for the LoRA weights you are training.
|
| 101 |
+
dtype = 'bfloat16'
|
| 102 |
+
# You can initialize the lora weights from a previously trained lora.
|
| 103 |
+
#init_from_existing = '/data/diffusion_pipe_training_runs/something/epoch50'
|
| 104 |
+
|
| 105 |
+
[optimizer]
|
| 106 |
+
# AdamW from the optimi library is a good default since it automatically uses Kahan summation when training bfloat16 weights.
|
| 107 |
+
# Look at train.py for other options. You could also easily edit the file and add your own.
|
| 108 |
+
type = 'adamw_optimi'
|
| 109 |
+
lr = 2e-5
|
| 110 |
+
betas = [0.9, 0.99]
|
| 111 |
+
weight_decay = 0.01
|
| 112 |
+
eps = 1e-8
|