---
title: HunyuanVideo
canonical_url: "https://www.modelscope.cn/models/Xorbits/HunyuanVideo"
md_url: "https://www.modelscope.cn/models/Xorbits/HunyuanVideo.md"
repository: Xorbits/HunyuanVideo
last_updated: 2024-12-31
pipeline_tag: text-to-video-synthesis
tasks:
  - text-to-video-synthesis
base_model:
  - tencent/HunyuanVideo
base_model_relation: finetune
parameters: 20.7B
tensor_type:
  - BF16
  - F32
  - F16
library_name:
  - pytorch
  - safetensors
  - diffusers
frameworks:
  - Pytorch
downloads: 8772
stars: 3
---

# HunyuanVideo

> HunyuanVideo - Xorbits 在 ModelScope 开源的模型。Unofficial community fork for Diffusers-format weights on tencent/HunyuanVideo.

Xorbits/HunyuanVideo 是 ModelScope 魔搭社区上的 20.7B 参数text-to-video-synthesis模型，基于 tencent/HunyuanVideo 构建。

- **Repository**: Xorbits/HunyuanVideo
- **Tasks**: text-to-video-synthesis
- **Parameters**: 20.7B
- **Base model**: tencent/HunyuanVideo
- **Downloads**: 8772
- **Stars**: 3
- **Last updated**: 2024-12-31

Source: https://www.modelscope.cn/models/Xorbits/HunyuanVideo

---

Unofficial community fork for Diffusers-format weights on [`tencent/HunyuanVideo`](https://huggingface.co/tencent/HunyuanVideo).

### Using Diffusers

HunyuanVideo can be used directly from Diffusers. Install the latest version of Diffusers.

```python
import torch
from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
from diffusers.utils import export_to_video

model_id = "hunyuanvideo-community/HunyuanVideo"
transformer = HunyuanVideoTransformer3DModel.from_pretrained(
    model_id, subfolder="transformer", torch_dtype=torch.bfloat16
)
pipe = HunyuanVideoPipeline.from_pretrained(model_id, transformer=transformer, torch_dtype=torch.float16)

# Enable memory savings
pipe.vae.enable_tiling()
pipe.enable_model_cpu_offload()

output = pipe(
    prompt="A cat walks on the grass, realistic",
    height=320,
    width=512,
    num_frames=61,
    num_inference_steps=30,
).frames[0]
export_to_video(output, "output.mp4", fps=15)
```

Refer to the [documentation](https://huggingface.co/docs/diffusers/main/en/api/pipelines/hunyuan_video) for more information.
