Instructions to use vanzl/DiffusionART-HunyuanVideo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use vanzl/DiffusionART-HunyuanVideo with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("vanzl/DiffusionART-HunyuanVideo", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Simplify model card: links, inference and selected videos
Browse files
README.md
CHANGED
|
@@ -3,167 +3,110 @@ license: other
|
|
| 3 |
license_name: tencent-hunyuan-community
|
| 4 |
license_link: https://huggingface.co/tencent/HunyuanVideo/blob/6204ad6aea1a77ff5aba337c88278bb9500eb37/LICENSE
|
| 5 |
base_model: hunyuanvideo-community/HunyuanVideo
|
|
|
|
| 6 |
tags:
|
| 7 |
-
- text-to-video
|
| 8 |
- hunyuanvideo
|
| 9 |
- diffusionart
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# DiffusionART
|
| 13 |
|
|
|
|
|
|
|
| 14 |
[Project Page](https://vanzll.github.io/diffusionart-project/) ·
|
| 15 |
-
[
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
The original HunyuanVideo-13B transformer was trained with temporal alignment,
|
| 21 |
-
video quality, and motion quality rewards weighted 0.7 / 0.2 / 0.1, plus a
|
| 22 |
-
frozen pretrained-velocity MSE regularizer with beta 0.1. The transformer is
|
| 23 |
-
stored as F32 safetensors shards. The public base model supplies the VAE, text
|
| 24 |
-
encoders, tokenizers, and scheduler. `release.json` records the source and shard
|
| 25 |
-
hashes; this inference update does not alter those files.
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
-
references for the same prompts. The two inference paths are not an
|
| 31 |
-
identical-noise controlled comparison.
|
| 32 |
-
More results: [Project Page](https://vanzll.github.io/diffusionart-project/).
|
| 33 |
|
| 34 |
-
|
|
|
|
| 35 |
|
| 36 |
-
<
|
| 37 |
-
<
|
| 38 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00100-diffusionart.mp4"></video></td>
|
| 39 |
-
</tr></table>
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00106-pretrained.mp4"></video></td>
|
| 45 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00106-diffusionart.mp4"></video></td>
|
| 46 |
-
</tr></table>
|
| 47 |
-
|
| 48 |
-
**A white horse gallops through shallow water along a sunlit beach.**
|
| 49 |
-
|
| 50 |
-
<table><tr><th>Pretrained</th><th>DiffusionART</th></tr><tr>
|
| 51 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00113-pretrained.mp4"></video></td>
|
| 52 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00113-diffusionart.mp4"></video></td>
|
| 53 |
-
</tr></table>
|
| 54 |
-
|
| 55 |
-
**A chef pours hot tea into a glass cup as steam rises.**
|
| 56 |
-
|
| 57 |
-
<table><tr><th>Pretrained</th><th>DiffusionART</th></tr><tr>
|
| 58 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00129-pretrained.mp4"></video></td>
|
| 59 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00129-diffusionart.mp4"></video></td>
|
| 60 |
-
</tr></table>
|
| 61 |
-
|
| 62 |
-
**The camera approaches a glass pavilion surrounded by autumn trees.**
|
| 63 |
-
|
| 64 |
-
<table><tr><th>Pretrained</th><th>DiffusionART</th></tr><tr>
|
| 65 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00139-pretrained.mp4"></video></td>
|
| 66 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00139-diffusionart.mp4"></video></td>
|
| 67 |
-
</tr></table>
|
| 68 |
-
|
| 69 |
-
**Sunlight sparkles through a rotating crystal prism on a white surface.**
|
| 70 |
-
|
| 71 |
-
<table><tr><th>Pretrained</th><th>DiffusionART</th></tr><tr>
|
| 72 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00148-pretrained.mp4"></video></td>
|
| 73 |
-
<td><video controls muted loop playsinline width="280" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00148-diffusionart.mp4"></video></td>
|
| 74 |
-
</tr></table>
|
| 75 |
-
|
| 76 |
-
## Requirements
|
| 77 |
-
|
| 78 |
-
- Access to this private Hugging Face repository through `HF_TOKEN` or an
|
| 79 |
-
interactive Hugging Face login. The commands keep the login and model cache
|
| 80 |
-
in the chosen work directory. Do not put a token in a script or shell history.
|
| 81 |
-
- Linux x86-64, Python **3.12**, a CUDA 12.1 compatible NVIDIA driver and CUDA
|
| 82 |
-
toolkit (`nvcc`) for building the pinned `flash-attn` version, plus `curl`,
|
| 83 |
-
`tar`, and `sha256sum`.
|
| 84 |
-
- One H800 with **at least 100 GiB available GPU memory** for the verified
|
| 85 |
-
default path. Independent inference used one 140 GiB H800 and peaked at
|
| 86 |
-
92.39 GiB allocated. Allow at least **100 GiB writable disk space** for the
|
| 87 |
-
private transformer, pinned public base assets, and installation caches.
|
| 88 |
-
`--cpu-offload` is available for constrained GPUs but was not part of the
|
| 89 |
-
independent acceptance run.
|
| 90 |
-
|
| 91 |
-
## Install and generate one MP4
|
| 92 |
-
|
| 93 |
-
The commands use only this release and the fixed **public**
|
| 94 |
-
[`XueZeyue/DanceGRPO`](https://github.com/XueZeyue/DanceGRPO/tree/15cc71d53cc2e6e18a68ee607d5fb6ba9a99e344)
|
| 95 |
-
runtime. No private training repository, saved prompt embeddings, notebook, or
|
| 96 |
-
MPI launcher is needed. Choose a work directory with the required free space.
|
| 97 |
|
| 98 |
```bash
|
| 99 |
export RUN_DIR="${RUN_DIR:-$PWD/diffusionart-t2v-demo}"
|
| 100 |
export HF_HOME="$RUN_DIR/cache/hf"
|
| 101 |
-
export HF_HUB_CACHE="$HF_HOME/hub"
|
| 102 |
export PIP_CACHE_DIR="$RUN_DIR/pip-cache"
|
| 103 |
export TMPDIR="$RUN_DIR/tmp"
|
| 104 |
export XDG_CACHE_HOME="$RUN_DIR/xdg-cache"
|
| 105 |
-
mkdir -p "$RUN_DIR" "$HF_HOME" "$
|
| 106 |
cd "$RUN_DIR"
|
| 107 |
python3.12 -m venv bootstrap
|
| 108 |
bootstrap/bin/python -m pip install 'huggingface-hub==0.26.1'
|
| 109 |
-
|
| 110 |
-
bootstrap/bin/huggingface-cli login
|
| 111 |
-
fi
|
| 112 |
-
|
| 113 |
-
# If MODEL_REVISION is already set to a known 40-character commit SHA, keep it.
|
| 114 |
-
# Otherwise resolve main exactly once, then pin every download to that SHA.
|
| 115 |
-
if [ -z "${MODEL_REVISION:-}" ]; then
|
| 116 |
-
MODEL_REVISION="$(bootstrap/bin/python -c 'from huggingface_hub import HfApi; print(HfApi().model_info("vanzl/DiffusionART-HunyuanVideo-7-2-1", token=True).sha)')"
|
| 117 |
-
fi
|
| 118 |
-
export MODEL_REVISION
|
| 119 |
-
printf 'Pinned model revision: %s\n' "$MODEL_REVISION"
|
| 120 |
|
| 121 |
bootstrap/bin/python - <<'PY'
|
| 122 |
-
import os
|
| 123 |
from huggingface_hub import snapshot_download
|
| 124 |
snapshot_download(
|
| 125 |
-
|
| 126 |
-
revision=
|
| 127 |
-
|
| 128 |
-
allow_patterns=["README.md", "infer.py", "install.sh", "requirements-inference.txt"],
|
| 129 |
local_dir="release",
|
| 130 |
)
|
| 131 |
PY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
```
|
| 141 |
|
| 142 |
-
|
| 143 |
-
the
|
| 144 |
-
`
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
##
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
and [Notice](Notice) before use. The model card and inference helpers do not
|
| 168 |
-
change their terms. The original run was planned for 100 updates but stopped
|
| 169 |
-
at step 40; this release selects step 30 and does not claim 100 updates.
|
|
|
|
| 3 |
license_name: tencent-hunyuan-community
|
| 4 |
license_link: https://huggingface.co/tencent/HunyuanVideo/blob/6204ad6aea1a77ff5aba337c88278bb9500eb37/LICENSE
|
| 5 |
base_model: hunyuanvideo-community/HunyuanVideo
|
| 6 |
+
pipeline_tag: text-to-video
|
| 7 |
tags:
|
|
|
|
| 8 |
- hunyuanvideo
|
| 9 |
- diffusionart
|
| 10 |
+
- arxiv:2610.12572
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# DiffusionART · HunyuanVideo
|
| 14 |
|
| 15 |
+
[Paper](https://arxiv.org/abs/2610.12572) ·
|
| 16 |
+
[Code](https://github.com/vanzll/DiffusionART) ·
|
| 17 |
[Project Page](https://vanzll.github.io/diffusionart-project/) ·
|
| 18 |
+
[Demo](https://vanzll.github.io/diffusionart-project/demo.html)
|
| 19 |
|
| 20 |
+
HunyuanVideo-13B fine-tuned with **DiffusionART**, using temporal alignment,
|
| 21 |
+
visual quality and motion quality rewards at **7:2:1**, with a pretrained-reference
|
| 22 |
+
MSE regularizer (β = 0.1).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
This repository contains the **full transformer weights**, not a LoRA or a
|
| 25 |
+
complete pipeline. The inference entry below downloads the base model's VAE
|
| 26 |
+
and text encoders automatically.
|
| 27 |
|
| 28 |
+
## Inference
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
Use the included [infer.py](https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/blob/main/infer.py).
|
| 31 |
+
Expand the setup once, then run the example from the same directory.
|
| 32 |
|
| 33 |
+
<details>
|
| 34 |
+
<summary>Environment setup</summary>
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
Linux, Python 3.12, a CUDA 12.1-compatible driver and toolkit (`nvcc`), and
|
| 37 |
+
approximately 100 GiB of available GPU memory and disk space for the verified
|
| 38 |
+
default path. The installer uses a pinned public DanceGRPO inference runtime.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
```bash
|
| 41 |
export RUN_DIR="${RUN_DIR:-$PWD/diffusionart-t2v-demo}"
|
| 42 |
export HF_HOME="$RUN_DIR/cache/hf"
|
|
|
|
| 43 |
export PIP_CACHE_DIR="$RUN_DIR/pip-cache"
|
| 44 |
export TMPDIR="$RUN_DIR/tmp"
|
| 45 |
export XDG_CACHE_HOME="$RUN_DIR/xdg-cache"
|
| 46 |
+
mkdir -p "$RUN_DIR" "$HF_HOME" "$PIP_CACHE_DIR" "$TMPDIR" "$XDG_CACHE_HOME"
|
| 47 |
cd "$RUN_DIR"
|
| 48 |
python3.12 -m venv bootstrap
|
| 49 |
bootstrap/bin/python -m pip install 'huggingface-hub==0.26.1'
|
| 50 |
+
bootstrap/bin/huggingface-cli login
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
bootstrap/bin/python - <<'PY'
|
|
|
|
| 53 |
from huggingface_hub import snapshot_download
|
| 54 |
snapshot_download(
|
| 55 |
+
"vanzl/DiffusionART-HunyuanVideo-7-2-1",
|
| 56 |
+
revision="b9f83d8fc677be078cf20e75e2149a5f69059220",
|
| 57 |
+
allow_patterns=["infer.py", "install.sh", "requirements-inference.txt"],
|
|
|
|
| 58 |
local_dir="release",
|
| 59 |
)
|
| 60 |
PY
|
| 61 |
+
bash release/install.sh "$RUN_DIR/venv" "$RUN_DIR/runtime"
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
The fixed revision preserves the released weights and inference entry.
|
| 65 |
+
Hugging Face login is used by that entry even though this model is public.
|
| 66 |
|
| 67 |
+
</details>
|
| 68 |
+
|
| 69 |
+
```bash
|
| 70 |
+
venv/bin/python - <<'PY'
|
| 71 |
+
import runpy
|
| 72 |
+
import sys
|
| 73 |
+
import torch
|
| 74 |
+
|
| 75 |
+
# Use the attention backend from the successful inference checks.
|
| 76 |
+
torch.backends.cuda.enable_cudnn_sdp(False)
|
| 77 |
+
sys.argv = [
|
| 78 |
+
"infer.py",
|
| 79 |
+
"--revision", "b9f83d8fc677be078cf20e75e2149a5f69059220",
|
| 80 |
+
"--prompt", "A white horse gallops through shallow water along a sunlit beach.",
|
| 81 |
+
"--output", "diffusionart.mp4",
|
| 82 |
+
"--cache-dir", "cache",
|
| 83 |
+
]
|
| 84 |
+
runpy.run_path("release/infer.py", run_name="__main__")
|
| 85 |
+
PY
|
| 86 |
```
|
| 87 |
|
| 88 |
+
Defaults: **640×640 · 53 frames · 8 FPS · 30 sampling steps**.
|
| 89 |
+
The script uses the verified shift, guidance, precision and VAE settings.
|
| 90 |
+
Change `--prompt` and `--output` for another video; an existing output is never overwritten.
|
| 91 |
+
|
| 92 |
+
## Examples
|
| 93 |
+
|
| 94 |
+
Selected outputs from this model. See the [Demo](https://vanzll.github.io/diffusionart-project/demo.html)
|
| 95 |
+
for the full gallery and pretrained comparisons.
|
| 96 |
+
|
| 97 |
+
<table>
|
| 98 |
+
<tr>
|
| 99 |
+
<td><video controls muted loop playsinline preload="none" width="280" poster="https://vanzll.github.io/diffusionart-project/assets/hf-video-00113-after.jpg" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00113-diffusionart.mp4"></video><p>A white horse gallops through shallow water along a sunlit beach.</p></td>
|
| 100 |
+
<td><video controls muted loop playsinline preload="none" width="280" poster="https://vanzll.github.io/diffusionart-project/assets/hf-video-00139-after.jpg" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00139-diffusionart.mp4"></video><p>The camera approaches a glass pavilion surrounded by autumn trees.</p></td>
|
| 101 |
+
</tr>
|
| 102 |
+
<tr>
|
| 103 |
+
<td><video controls muted loop playsinline preload="none" width="280" poster="https://vanzll.github.io/diffusionart-project/assets/hf-video-00106-after.jpg" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00106-diffusionart.mp4"></video><p>The camera follows a winding river through a valley of autumn trees.</p></td>
|
| 104 |
+
<td><video controls muted loop playsinline preload="none" width="280" poster="https://vanzll.github.io/diffusionart-project/assets/hf-video-00148-after.jpg" src="https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/resolve/main/examples/00148-diffusionart.mp4"></video><p>Sunlight sparkles through a rotating crystal prism on a white surface.</p></td>
|
| 105 |
+
</tr>
|
| 106 |
+
</table>
|
| 107 |
+
|
| 108 |
+
## License
|
| 109 |
+
|
| 110 |
+
Subject to the [Tencent Hunyuan Community License](https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/blob/main/LICENSE.txt)
|
| 111 |
+
and [Notice](https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/blob/main/Notice).
|
| 112 |
+
Training provenance and weight hashes are recorded in [release.json](https://huggingface.co/vanzl/DiffusionART-HunyuanVideo-7-2-1/blob/main/release.json).
|
|
|
|
|
|
|
|
|