Hunyuan Video - Installation In GPU Server Steps (Patreon)
Videos
-
387697573.mp4
Downloads
Content
If you want speed like me , use either H100 or A100 (with 80GB VRam) for new AI video model such as Hunyuan Video, there are some GPU Server like this in Runpod and Modal.
Here the steps in the Command Prompt setup for Hunyuan Video:
1 - clone the project
git clone https://github.com/Tencent/HunyuanVideo && cd HunyuanVideo
2 - setup virtual environment
If you want to set up a virtual environment (optional):
bash Anaconda-latest-Linux-x86_64.sh
conda env create -f environment.yml
conda activate HunyuanVideo
conda install gcc_linux-64 gxx_linux-64 -y conda install cuda -c nvidia -y
3 - Install libraries
python -m pip install -r requirements.txt
pip install packaging
pip uninstall -y ninja && pip install ninja
python -m pip install git+https://github.com/Dao-AILab/flash-attention.git@v2.5.9.post1
4 - Download Model from HF
huggingface-cli login
(get Read token from huggingface.co)
huggingface-cli download tencent/HunyuanVideo --local-dir ./ckpts
cd HunyuanVideo/ckpts
huggingface-cli download xtuner/llava-llama-3-8b-v1_1-transformers --local-dir ./llava-llama-3-8b-v1_1-transformers
cd ../
python hyvideo/utils/preprocess_text_encoder_tokenizer_utils.py --input_dir ckpts/llava-llama-3-8b-v1_1-transformers --output_dir ckpts/text_encoder
cd HunyuanVideo/ckpts
huggingface-cli download openai/clip-vit-large-patch14 --local-dir ./text_encoder_2
5 - After install everything, you should be ready to get start.
Go to the main folder:
cd HunyuanVideo
Run Text2Video script with parameters for video generation:
python3 sample_video.py --video-size 720 1280 --video-length 129 --infer-steps 30 --prompt "a cat is running, realistic." --flow-reverse --seed 0 --use-cpu-offload --save-path ./results*** Replace the text prompt "a cat is running, realistic." with your own text prompt.
Have Fun!
Files