HunyuanVideo-Training is a lightweight framework for training the HunyuanVideo video generation model, hosted on GitHub. It is not a comprehensive all-in-one trainer, but rather a minimal framework designed to support simple single-file training scripts, in a style similar to diffusers' example training scripts. Its design goal is to be easy to read and modify, avoiding excessive abstraction, while being sufficiently optimized that users can train without renting cloud computing resources.
In terms of main capabilities, the framework's default configuration uses less than 16 GB of VRAM (targeting under 24 GB), and can run natively on Windows. To achieve this, the diffusion model is quantized to nf4 via bitsandbytes (similar to QLoRA), text embeddings are precomputed, and latents are encoded on the fly to reduce overfitting and make it easier to handle larger datasets. It supports image and video files, and captions should be .txt files with the same name as the media files. Training data should be placed in the /train directory, and validation data in the /val, /validation, or /test directories; subfolders are scanned recursively. If no validation set is provided, validation will fall back to the training set, but this is not recommended.
In terms of usage, users need to first activate the virtual environment (on Windows, launch_venv.bat can be used), then download the model (or specify --pretrained_model to point to an existing model folder), and cache the text embeddings. During training, by default the resolution is randomized within buckets, the frame length is set based on the context length budget, and the starting frame is randomly selected. The default --token_limit is 10000, suitable for < 16 GB VRAM, at about 30 seconds/step on a 3090. Increasing the token limit will increase memory and time. Optionally set --resolution to disable resolution buckets and use square cropping, and --num_frames to set the maximum number of frames. For image-to-video training, use --skyreels_i2v to load the skyreels model and use the first frame as the image condition. Go With The Flow's warped noise can be enabled via --warped_noise, but it takes longer to adapt and is more suitable for general adapter training rather than character/style LoRA, and requires a large dataset. Saved LoRA checkpoints are in diffusers format; if they need to be used with the original Tencent model or ComfyUI, conversion is required, and optionally the LoRA data type can be converted to bf16 or fp16 to reduce file size.
The applicable scenarios are mainly users who want to adjust the training code themselves, perform fine-tuning of the HunyuanVideo model, or train LoRA, especially developers who are dissatisfied with diffusers' recent video models shifting from single-file training scripts to finetrainers. In terms of limitations, this tool does not provide comprehensive support; it is mainly for the author's own use and is shared with users willing to try the training code. The code is under the MIT license, but the HunyuanVideo model is subject to the Tencent Community License.