Instructions to use ByteDance/Bernini-Diffusers-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ByteDance/Bernini-Diffusers-v2 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ByteDance/Bernini-Diffusers-v2", 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
File size: 6,897 Bytes
2e624cf 16217e7 2e624cf 16217e7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | ---
license: apache-2.0
pipeline_tag: image-text-to-video
---
<div align="center">
<img src="assets/bernini-icon.png" width="560" alt="Bernini"/>
<h4 align="center">Latent Semantic Planning for Video Diffusion</h4>
**Chenchen Liu<sup>\*</sup>, Junyi Chen<sup>\*</sup>, Lei Li<sup>\*</sup>, Lu Chi<sup>\*,Β§</sup>, Mingzhen Sun<sup>\*</sup>, Zhuoying Li<sup>\*</sup>, Yi Fu, Ruoyu Guo, Yiheng Wu, Ge Bai, Zehuan Yuan<sup>β</sup>**
<sup>\*</sup> Equal contribution <sup>β</sup> Corresponding author <sup>Β§</sup> Project lead
[](https://arxiv.org/abs/2605.22344)
[](https://bernini-ai.github.io/)
[](https://huggingface.co/collections/ByteDance/bernini)
</div>
## π News
- **[2026-06-11]** We open-sourced the inference code and model weights of the full Bernini (**Bernini**).
- **[2026-05-22]** We released our paper [Bernini: Latent Semantic Planning for Video Diffusion](https://arxiv.org/abs/2605.22344).
## β¨ Highlights
Bernini is a unified framework for video generation and editing that combines an MLLM-based semantic planner with a DiT-based renderer.
**Bernini-Diffusers-v2** packages the full semantic-planning pipeline: a Qwen2.5-VL planner, Bernini planning weights, and Wan2.2 diffusion components in one self-contained diffusers-format directory.
Compared with the renderer-only Bernini-R releases, Bernini-Diffusers-v2 is recommended when you need stronger instruction following, multi-step semantic planning, and better handling of complex video generation or editing requests. Compared with the first Bernini-Diffusers release, v2 uses a training recipe that warms up the connector for thousands of steps before co-training, improving reference-guided video editing and OpenS2V performance.
## π§Ύ Model card
| Field | Description |
|-------|-------------|
| Model type | Full video generation/editing pipeline with an MLLM-based semantic planner and a DiT-based renderer. |
| Checkpoint | [`ByteDance/Bernini-Diffusers-v2`](https://huggingface.co/ByteDance/Bernini-Diffusers-v2) |
| Code | [`ByteDance/Bernini`](https://github.com/bytedance/Bernini) |
| Renderer base | [`Wan2.2-T2V-A14B`](https://huggingface.co/Wan-AI/Wan2.2-T2V-A14B) |
| Planner base | [`Qwen2.5-VL-7B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct) |
| Recommended use | Complex generation/editing requests that benefit from explicit latent semantic planning and stronger instruction following. |
| Supported tasks | `t2i`, `i2i`, `t2v`, `v2v`, `rv2v`, and `r2v`. |
| Model behavior | Decomposes complex instructions and plans semantic changes before rendering, at the cost of a heavier checkpoint layout than Bernini-R. |
### Benchmark snapshot
| Model | EditVerse | OpenVE | OpenS2V | VBench | Bernini-v2v (OS) | Bernini-rv2v (OS) |
|---|---|---|---|---|---|---|
| [Bernini-v2 7+14B](https://huggingface.co/ByteDance/Bernini-Diffusers-v2) | 8.02 | 3.96 | 63.83 | 84.46 | 3.49 | 3.55 |
On video editing, Bernini reaches the first tier among leading closed-source commercial models in our internal arena evaluation based on blind human pairwise comparisons.
## π¦ Package layout
This release is a **self-contained diffusers-format directory**. Pass the downloaded `Bernini-Diffusers-v2` directory directly to `--config`.
```text
Bernini-Diffusers-v2/
bernini/
mllm/
scheduler/
t5_text_encoder/
t5_tokenizer/
vae/
config.json
transformer_config.json
transformer_2_config.json
```
At runtime:
- `bernini/` provides the Bernini planning checkpoint.
- `mllm/` provides the Qwen2.5-VL planner assets.
- `transformer_config.json` and `transformer_2_config.json` define the Wan2.2 diffusion decoder components used by the full pipeline.
- `t5_text_encoder/`, `t5_tokenizer/`, `vae/`, and `scheduler/` provide the base diffusion modules required for inference.
## π₯ Download
```bash
pip install -U "huggingface_hub"
hf download ByteDance/Bernini-Diffusers-v2 \
--local-dir pretrained_models/Bernini-Diffusers-v2
```
## π Usage
The official inference code is available in the [Bernini repository](https://github.com/bytedance/Bernini).
### Installation
```bash
git clone https://github.com/bytedance/Bernini.git bernini && cd bernini
pip install -r requirements.txt
# Open-VeOmni is required. Install it with --no-deps so it does not pull in a
# different torch build and override the pinned torch==2.7.1+cu126:
pip install --no-deps git+https://github.com/ByteDance-Seed/VeOmni.git@v0.1.11
```
Recommended environment:
- **Python** 3.11.2
- **PyTorch** 2.7.1+cu126
- **CUDA toolkit** 12.6
- **GPU** Hopper GPUs (H100/H800/H200) are recommended for best performance
### Load the model
Pass the downloaded directory directly as `--config`:
```bash
python infer_single_gpu.py --config pretrained_models/Bernini-Diffusers-v2 \
--case assets/testcases/i2i/i2i.json --num_frames 1
```
### Prompt enhancer (highly recommended)
`--use_pe` enhances the prompt through an OpenAI-compatible endpoint and is recommended for best generation quality.
```bash
export BERNINI_PE_API_KEY=... # or OPENAI_API_KEY
export BERNINI_PE_BASE_URL=... # or OPENAI_BASE_URL
export BERNINI_PE_MODEL=... # vision-capable chat model
```
### Gradio demo
```bash
# Single GPU
python gradio_demo.py --config pretrained_models/Bernini-Diffusers-v2 --port 7860
# 8 GPUs, 8-way Ulysses sequence parallel
torchrun --nproc-per-node 8 gradio_demo.py --ulysses 8 \
--config pretrained_models/Bernini-Diffusers-v2 \
--port 7860 --share
```
### Run scripts
The [`scripts/bernini_v2/`](https://github.com/bytedance/Bernini/tree/master/scripts/bernini_v2) directory in the Bernini repo provides ready-to-run task launchers for Bernini-Diffusers-v2:
- `run_t2i.sh`
- `run_i2i.sh`
- `run_t2v.sh`
- `run_v2v.sh`
- `run_rv2v.sh`
- `run_r2v.sh`
- `run_gradio.sh`
You can override the model directory with:
```bash
export BERNINI_CONFIG=/path/to/Bernini-Diffusers-v2
```
## π Citation
If you use Bernini in your research, please cite:
```bibtex
@article{bernini,
title = {Bernini: Latent Semantic Planning for Video Diffusion},
author = {Chenchen Liu and Junyi Chen and Lei Li and Lu Chi and Mingzhen Sun and Zhuoying Li and Yi Fu and Ruoyu Guo and Yiheng Wu and Ge Bai and Zehuan Yuan},
journal = {arXiv preprint arXiv:2605.22344},
year = {2026}
}
```
## π Acknowledgements
Bernini builds on several outstanding open-source projects:
- [Wan2.2-T2V-A14B](https://huggingface.co/Wan-AI/Wan2.2-T2V-A14B)
- [Qwen2.5-VL-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct)
- [VeOmni](https://github.com/ByteDance-Seed/VeOmni)
## π License
Apache License 2.0.
|