A solution for smooth video generation on low graphics memory GPUs
HunyuanVideoGP provides the following specific optimization solutions for hardware with limited video memory:
- Quantitative model selection: Prioritizing the quantized version of the model can reduce the memory usage by about 30%. In the model switching option of the Gradio interface, select the model with the "quantized" logo.
- Configuration file optimization: Special configuration files for 12GB/16GB/24GB video memory are pre-installed in the installer, and the corresponding parameters are added at startup via the launch.sh script, e.g.
--config config_12gb.json
- Memory Management Technology: Video data can be processed in chunks by utilizing a fast load/unload mechanism. It is recommended that the length of the generated video be limited to 5 seconds or less, and that long video requirements be addressed by generating and splicing multiple times
- Additional optimization measures: Setting up in a conda environment
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128
Environment variables to improve video memory fragmentation issues
For cases where there is still not enough video memory for continuous use, try adding the following to requirements.txtoptimum
library to enable its memory optimization features.
This answer comes from the articleHunyuanVideoGP: A Hybrid Video Generation Model with Support for Running on Low-End GPUsThe