HunyuanVideo: Uncensored Video Generation is here

hunyuan video installation

There are many closed source models, but HunyuanVideo is an open source video generation that is proved to be quite competitive in the market. Tencent released this video generative model trained with over 13 billion parameters promises to become the largest among varieties of models. You can find more in-depth understanding from their research paper.


The model produces professional looking videos that is capable to avoid repetitive movements, ensuring to experience the realistic motion. The video generation accurately matches textual prompting that delivers consistent outputs without glitches. 

Hunyuan Video Model performance comparision
Source-HunyuanVideo's Hugging Face repository

The researchers claimed that the HunyuanVideo outperformed the Luma1.6, Runway Gen3 and other Chinese video generation models. Lets see and test how this performs in ComfyUI. 

Table of Contents:


TYPE A: Native ComfyUI Support

Now, their is a official ComfyUI support available for HunyuanVideo. But, you can only run if you have at least 24GB VRAM other wise you will stuck into out-of-memory error. Lower VRAM users can opt for the second( By Kijai) and third(GGUF)quantized variant listed below.

Installation

0. Install ComfyUI if you are a new user.

1. Old users need to Update ComfyUI from the Manager section by selecting "Update ComfyUI" option.

1. Download Hunyuan model file from Hugging face repository. 

Save it into your "ComfyUI/models/diffusion_models" folder. Create new folder "diffusion_models", if you do not have.

2. Download VAE model from Hugging face and save it inside "ComfyUI/models/vae" folder.

3. Next, download the clip models (clip_l.safetensors and llava_llama3_fp8_scaled.safetensors) from Hugging face and put them into "ComfyUI/models/text_encoders" folder. 

4. Restart and refresh ComfyUI.

Workflow

1. Get the workflow from Comfyui's repository.

2. Drag and drop into ComfyUI.


TYPE B: Quantized variant By Kijai

Installing process

1. Install ComfyUI if you haven't done yet.

2. Older user need to choose "Update ComfyUI" option from the Manager to avoid any future errors.

3. Move into "ComfyUI/custom_node" folder and open command prompt.

Clone the ComfyUI HunyuanVideoWrapper Kijai's repository using following command:

git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper.git

Another option is to use ComfyUI manager then select "Install from git url" option and paste the Git url provided above without "git clone".

download HunyuanVideo model

4. Download the respective quantized HunyuanVideo model from Hugging face repository

There are multiple options to choose from. Select the one which suits your machine requirements. Here, Fp8 variant is for 12 GB and lower VRAMs, and BF16 for higher.

After downloading the models, save it into your "ComfyUI/models/diffusion_models" folder.

Also download the required VAE and save it into "ComfyUI/models/vae" folder.


Download llava lama3 model

5. Next is to download all text encoders and its files shown above from respective Hugging Face repository and place them into your "ComfyUI/models/LLM/llava-llama-3-8b-text-encoder-tokenizer" folder.


Download Clip vit model

6. Now, download OpenAI's transformer based Clip Vit Large Model and files(illustrated above) from their Hugging face repository and put them into your "ComfyUI/models/clip/clip-vit-large-patch14" directory.

Optional(for windows users): Another point we want to mention is that you can install Triton and Sage-Attention which will significantly drop the video rendering time to almost 25% as reported by the community. 

install windows triton whl files

Install Windows Trition .whl file for your python version. To check python version run "python --version" (without quotes) in command prompt. We have python 3.10 version installed. For other python version checkout Windows Trition release section.

For normal ComfyUI user this is the syntax. Replace the <<your-trition-python-version>> with your relevant .whl file.

Syntax:

pip install <<your-trition-python-version>>

pip install triton-3.1.0-cp310-cp310-win_amd64.whl

Then install sage-attention:

pip install sageattention

For Comfy Portable users, move inside ComfyUI_windows_portable folder and open command prompt and use the following syntax. Replace the <<your-trition-python-version>> with your relevant .whl file. 

Syntax:

.\python_embeded\python.exe -m pip install <<your-trition-python-version>>

.\python_embeded\python.exe -m pip install triton-3.1.0-cp310-cp310-win_amd64.whl

Then install sage-attention:

.\python_embeded\python.exe -m pip install sageattention

7. Restart and refresh your ComfyUI to take effect.


Workflow

1. Get the workflow from your "ComfyUI/custom_nodes/ComfyUI-HunyuanVideoWrapper/examples" folder.
(a) hyvideo_t2v_example_01.json (Text to Video workflow)
(b) hyvideo_v2v_example_01.json (Video to Video workflow)
(c) hyvideo_lowvram_blockswap_test.json (For Low VRAM users with block swapping technique)

2. Just directly drag and drop to ComfyUI. These are the settings you need to do as shown below.

Hunyuan video Loader node

(a) Load Hunyuan Video model

Hunyuan video  Sampler

(b) Set the video settings for video generation.

Load HunyuanVideo clip text encoders

(c) Load text encoder.

Hunyuan video  VAE Loader node

(d) Load the VAE with relevant precision type.

(e) Add positive prompt into Clip prompt box and hit "Queue" button to start generating.

We are using NVIDIA based RTX 3090 24GB VRAM and each video rendering time was around 5-6 minutes. The video frame quality is better in comparison to other video generation models but the time consumption is so lengthy.


TYPE C: GGUF variant by city96


Installation

1. Update ComfyUI from the Manager by selecting "Update ComfyUI" button.


Install custom nodes


2. Install GGUF custom nodes from the Manager by selecting "Custom nodes manager". Then search for "ComfyUI-GGUF" by City 96 (author) and hit install. If you already used the Flux GGUF or Stable Diffusion 3.5 GGUF variant then you only need to update this custom node.

Download Hunyuan GGUF model

3. Download the model from City 96's Hugging Face repository and put it into "ComfyUI/models/unet" folder.

Here, you will have various model types from Q3bit(very light weight with lower quality gen) to Q8bit(very heavy weight with precision). Choose as per your system VRAM and requirements.

4. Now, get the same Kijai's VAE model from his repository and save it to your "ComfyUI/models/vae" folder.


Workflow

1. Download the same workflow of Comfyui's repository from Type A's workflow section.

2. All will be same here. Just replace the "Load Diffusion Model" node with "UNet Loader (GGUF)" node. Connect it to "Model Sampling SD3" node and "Basic scheduler" node. 

3. Now you are ready to go with it. Hit "Queue" button to start generation.