mirror of
https://www.modelscope.cn/Tencent-Hunyuan/HunyuanVideo-1.5.git
synced 2026-04-03 06:02:54 +08:00
update README (batch 1/1)
This commit is contained in:
66
README.md
66
README.md
@ -40,10 +40,10 @@ HunyuanVideo-1.5 is a video generation model that delivers top-tier quality with
|
||||
<a href="https://hunyuan.tencent.com/video/zh?tabIndex=0" target="_blank"><img src=https://img.shields.io/badge/Official%20Site-333399.svg?logo=homepage height=22px></a>
|
||||
<a href=https://huggingface.co/tencent/HunyuanVideo-1.5 target="_blank"><img src=https://img.shields.io/badge/%F0%9F%A4%97%20Models-d96902.svg height=22px></a>
|
||||
<a href=https://github.com/Tencent-Hunyuan/HunyuanVideo-1.5 target="_blank"><img src= https://img.shields.io/badge/Page-bb8a2e.svg?logo=github height=22px></a>
|
||||
<a href="https://github.com/Tencent-Hunyuan/HunyuanVideo-1.5/blob/main/assets/HunyuanVideo_1_5.pdf" target="_blank"><img src=https://img.shields.io/badge/Report-b5212f.svg?logo=arxiv height=22px></a>
|
||||
<a href="https://github.com/Tencent-Hunyuan/HunyuanVideo-1.5/blob/report/HunyuanVideo_1_5.pdf" target="_blank"><img src=https://img.shields.io/badge/Report-b5212f.svg?logo=arxiv height=22px></a>
|
||||
<a href=https://x.com/TencentHunyuan target="_blank"><img src=https://img.shields.io/badge/Hunyuan-black.svg?logo=x height=22px></a>
|
||||
<a href="https://doc.weixin.qq.com/doc/w3_AXcAcwZSAGgCNACVygLxeQjyn4FYS?scode=AJEAIQdfAAoSfXnTj0AAkA-gaeACk" target="_blank"><img src=https://img.shields.io/badge/📚-PromptHandBook-blue.svg?logo=book height=22px></a> <br/>
|
||||
<a href="https://github.com/comfyanonymous/ComfyUI" target="_blank"><img src=https://img.shields.io/badge/ComfyUI-blue.svg?logo=book height=22px></a>
|
||||
<a href="./ComfyUI/README.md" target="_blank"><img src=https://img.shields.io/badge/ComfyUI-blue.svg?logo=book height=22px></a>
|
||||
<a href="https://github.com/ModelTC/LightX2V" target="_blank"><img src=https://img.shields.io/badge/LightX2V-yellow.svg?logo=book height=22px></a>
|
||||
|
||||
</div>
|
||||
@ -67,7 +67,9 @@ HunyuanVideo-1.5 is a video generation model that delivers top-tier quality with
|
||||
|
||||
If you develop/use HunyuanVideo-1.5 in your projects, welcome to let us know.
|
||||
|
||||
- **ComfyUI** - [ComfyUI](https://github.com/comfyanonymous/ComfyUI): A powerful and modular diffusion model GUI with a graph/nodes interface. ComfyUI supports HunyuanVideo-1.5 with various engineering optimizations for fast inference.
|
||||
- **ComfyUI** - [ComfyUI](https://github.com/comfyanonymous/ComfyUI): A powerful and modular diffusion model GUI with a graph/nodes interface. ComfyUI supports HunyuanVideo-1.5 with various engineering optimizations for fast inference. We provide a [ComfyUI Usage Guide](./ComfyUI/README.md) for HunyuanVideo-1.5.
|
||||
|
||||
- **Community-implemented ComfyUI Plugin** - [comfyui_hunyuanvideo_1.5_plugin](https://github.com/yuanyuan-spec/comfyui_hunyuanvideo_1.5_plugin): A community-implemented ComfyUI plugin for HunyuanVideo-1.5, offering both simplified and complete node sets for quick usage or deep workflow customization, with built-in automatic model download support.
|
||||
|
||||
- **LightX2V** - [LightX2V](https://github.com/ModelTC/LightX2V): A lightweight and efficient video generation framework that integrates HunyuanVideo-1.5, supporting multiple engineering acceleration techniques for fast inference.
|
||||
|
||||
@ -95,6 +97,7 @@ If you develop/use HunyuanVideo-1.5 in your projects, welcome to let us know.
|
||||
- [Text to Video](#text-to-video)
|
||||
- [Image to Video](#image-to-video)
|
||||
- [Command Line Arguments](#command-line-arguments)
|
||||
- [Optimal Inference Configurations](#optimal-inference-configurations)
|
||||
- [🧱 Models Cards](#-models-cards)
|
||||
- [🎬 More Examples](#-more-examples)
|
||||
- [📊 Evaluation](#-evaluation)
|
||||
@ -157,8 +160,8 @@ pip install -i https://mirrors.tencent.com/pypi/simple/ --upgrade tencentcloud-s
|
||||
### Step 3: Install Attention Libraries
|
||||
|
||||
* Flash Attention:
|
||||
It's recommended to install Flash Attention for faster inference and reduced GPU memory consumption.
|
||||
Detailed installation instructions are available at [Flash Attention](https://github.com/Dao-AILab/flash-attention).
|
||||
Install Flash Attention for faster inference and reduced GPU memory consumption.
|
||||
Detailed installation instructions are available at [Flash Attention](https://github.com/Dao-AILab/flash-attention).
|
||||
|
||||
* Flex-Block-Attention:
|
||||
flex-block-attn is only required for sparse attention to achieve faster inference and can be installed by the following command:
|
||||
@ -169,6 +172,8 @@ Detailed installation instructions are available at [Flash Attention](https://gi
|
||||
```
|
||||
|
||||
* SageAttention:
|
||||
To enable SageAttention for faster inference, you need to install it by the following command:
|
||||
> **Note**: Enabling SageAttention will automatically disable Flex-Block-Attention.
|
||||
```bash
|
||||
git clone https://github.com/cooper1637/SageAttention.git
|
||||
cd SageAttention
|
||||
@ -223,10 +228,11 @@ OUTPUT_PATH=./outputs/output.mp4
|
||||
# Configuration
|
||||
N_INFERENCE_GPU=8 # Parallel inference GPU count
|
||||
CFG_DISTILLED=true # Inference with CFG distilled model, 2x speedup
|
||||
SPARSE_ATTN=true # Inference with sparse attention
|
||||
SPARSE_ATTN=false # Inference with sparse attention (only 720p models are equipped with sparse attention). Please ensure flex-block-attn is installed
|
||||
SAGE_ATTN=false # Inference with SageAttention
|
||||
REWRITE=true # Enable prompt rewriting. Please ensure rewrite vLLM server is deployed and configured.
|
||||
OVERLAP_GROUP_OFFLOADING=true # Only valid when group offloading is enabled, significantly increases CPU memory usage but speeds up inference
|
||||
MODEL_PATH=ckpts # Path to pretrained model
|
||||
REWRITE=true # Enable prompt rewriting
|
||||
|
||||
torchrun --nproc_per_node=$N_INFERENCE_GPU generate.py \
|
||||
--prompt "$PROMPT" \
|
||||
@ -239,10 +245,18 @@ torchrun --nproc_per_node=$N_INFERENCE_GPU generate.py \
|
||||
--use_sageattn $SAGE_ATTN \
|
||||
--rewrite $REWRITE \
|
||||
--output_path $OUTPUT_PATH \
|
||||
--overlap_group_offloading $OVERLAP_GROUP_OFFLOADING \
|
||||
--save_pre_sr_video \
|
||||
--model_path $MODEL_PATH
|
||||
```
|
||||
|
||||
> **Tips:** If your GPU memory is > 14GB but you encounter OOM (Out of Memory) errors during generation, you can try setting the following environment variable before running:
|
||||
> ```bash
|
||||
> export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True,max_split_size_mb:128
|
||||
> ```
|
||||
|
||||
|
||||
|
||||
### Command Line Arguments
|
||||
|
||||
| Argument | Type | Required | Default | Description |
|
||||
@ -264,6 +278,7 @@ torchrun --nproc_per_node=$N_INFERENCE_GPU generate.py \
|
||||
| `--sparse_attn` | bool | No | `false` | Enable sparse attention for faster inference (~1.5-2x speedup, requires H-series GPUs, auto-enables CFG distilled, use `--sparse_attn` or `--sparse_attn true` to enable) |
|
||||
| `--offloading` | bool | No | `true` | Enable CPU offloading (use `--offloading false` or `--offloading 0` to disable for faster inference if GPU memory allows) |
|
||||
| `--group_offloading` | bool | No | `None` | Enable group offloading (default: None, automatically enabled if offloading is enabled. Use `--group_offloading` or `--group_offloading true/1` to enable, `--group_offloading false/0` to disable) |
|
||||
| `--overlap_group_offloading` | bool | No | `true` | Enable overlap group offloading (default: true). Significantly increases CPU memory usage but speeds up inference. Use `--overlap_group_offloading` or `--overlap_group_offloading true/1` to enable, `--overlap_group_offloading false/0` to disable |
|
||||
| `--dtype` | str | No | `bf16` | Data type for transformer: `bf16` (faster, lower memory) or `fp32` (better quality, slower, higher memory) |
|
||||
| `--use_sageattn` | bool | No | `false` | Enable SageAttention (use `--use_sageattn` or `--use_sageattn true/1` to enable, `--use_sageattn false/0` to disable) |
|
||||
| `--sage_blocks_range` | str | No | `0-53` | SageAttention blocks range (e.g., `0-5` or `0,1,2,3,4,5`) |
|
||||
@ -271,22 +286,43 @@ torchrun --nproc_per_node=$N_INFERENCE_GPU generate.py \
|
||||
|
||||
**Note:** Use `--nproc_per_node` to specify the number of GPUs. For example, `--nproc_per_node=8` uses 8 GPUs.
|
||||
|
||||
### Optimal Inference Configurations
|
||||
|
||||
The following table provides the optimal inference configurations (CFG scale, embedded CFG scale, flow shift, and inference steps) for each model to achieve the best generation quality:
|
||||
|
||||
| Model | CFG Scale | Embedded CFG Scale | Flow Shift | Inference Steps |
|
||||
|-------|-----------|-------------------|------------|-----------------|
|
||||
| 480p T2V | 6 | None | 5 | 50 |
|
||||
| 480p I2V | 6 | None | 5 | 50 |
|
||||
| 720p T2V | 6 | None | 9 | 50 |
|
||||
| 720p I2V | 6 | None | 7 | 50 |
|
||||
| 480p T2V CFG Distilled | 1 | None | 5 | 50 |
|
||||
| 480p I2V CFG Distilled | 1 | None | 5 | 50 |
|
||||
| 720p T2V CFG Distilled | 1 | None | 9 | 50 |
|
||||
| 720p I2V CFG Distilled | 1 | None | 7 | 50 |
|
||||
| 720p T2V CFG Distilled Sparse | 1 | None | 7 | 50 |
|
||||
| 720p I2V CFG Distilled Sparse | 1 | None | 9 | 50 |
|
||||
| 480→720 SR Step Distilled | 1 | None | 2 | 6 |
|
||||
| 720→1080 SR Step Distilled | 1 | None | 2 | 8 |
|
||||
|
||||
**Please note that the cfg distilled model we provided, must use 50 steps to generate correct results.**
|
||||
|
||||
|
||||
## 🧱 Models Cards
|
||||
|ModelName| Download |
|
||||
|-|---------------------------|
|
||||
|HunyuanVideo-1.5-480P-T2V|[480P-T2V](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/480p_t2v) |
|
||||
|HunyuanVideo-1.5-480P-I2V |[480P-I2V](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/480p_i2v) |
|
||||
|HunyuanVideo-1.5-480P-T2V-distill | [480P-T2V-distill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/480p_t2v_distilled) |
|
||||
|HunyuanVideo-1.5-480P-I2V-distill |[480P-I2V-distill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/480p_i2v_distilled) |
|
||||
|HunyuanVideo-1.5-480P-T2V-cfg-distill | [480P-T2V-cfg-distill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/480p_t2v_distilled) |
|
||||
|HunyuanVideo-1.5-480P-I2V-cfg-distill |[480P-I2V-cfg-distill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/480p_i2v_distilled) |
|
||||
|HunyuanVideo-1.5-720P-T2V|[720P-T2V](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_t2v) |
|
||||
|HunyuanVideo-1.5-720P-I2V |[720P-I2V](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_i2v) |
|
||||
|HunyuanVideo-1.5-720P-T2V-distiill| Comming soon |
|
||||
|HunyuanVideo-1.5-720P-I2V-distiill |[720P-I2V-distiill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_i2v_distilled) |
|
||||
|HunyuanVideo-1.5-720P-T2V-sparse-distiill| Comming soon |
|
||||
|HunyuanVideo-1.5-720P-I2V-sparse-distiill |[720P-I2V-sparse-distiill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_i2v_distilled_sparse) |
|
||||
|HunyuanVideo-1.5-720P-sr |[720P-sr](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_sr_distilled) |
|
||||
|HunyuanVideo-1.5-1080P-sr |[1080P-sr](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/1080p_sr_distilled) |
|
||||
|HunyuanVideo-1.5-720P-T2V-cfg-distill| Comming soon |
|
||||
|HunyuanVideo-1.5-720P-I2V-cfg-distill |[720P-I2V-cfg-distill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_i2v_distilled) |
|
||||
|HunyuanVideo-1.5-720P-T2V-sparse-cfg-distill| Comming soon |
|
||||
|HunyuanVideo-1.5-720P-I2V-sparse-cfg-distill |[720P-I2V-sparse-cfg-distill](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_i2v_distilled_sparse) |
|
||||
|HunyuanVideo-1.5-720P-sr-step-distill |[720P-sr](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/720p_sr_distilled) |
|
||||
|HunyuanVideo-1.5-1080P-sr-step-distill |[1080P-sr](https://huggingface.co/tencent/HunyuanVideo-1.5/tree/main/transformer/1080p_sr_distilled) |
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user