ByteDance / Bernini-R-Diffusers

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: June 02 2026
image-text-to-video

Introduction of Bernini-R-Diffusers

Model Details of Bernini-R-Diffusers

Bernini
Latent Semantic Planning for Video Diffusion

Chenchen Liu * , Junyi Chen * , Lei Li * , Lu Chi *,§ , Mingzhen Sun * , Zhuoying Li * , Yi Fu, Ruoyu Guo, Yiheng Wu, Ge Bai, Zehuan Yuan

* Equal contribution Corresponding author § Project lead

arXiv Project Page HuggingFace

🎉 News
✨ Highlights

Bernini is a unified framework for video generation and editing that combines an MLLM-based semantic planner with a DiT-based renderer.

On video editing, Bernini reaches the first tier among leading closed-source commercial models. The leaderboard below comes from our self-built arena platform, where human annotators blindly vote on paired edits and the votes are aggregated into a Bradley-Terry score and a pairwise win-rate matrix.

Video editing arena: Bradley-Terry leaderboard and pairwise win-rate matrix
📦 Installation
Requirements
  • Python 3.11.2.
  • CUDA GPU — a Hopper GPU (H100/H800/H200) is recommended so FlashAttention-3 can be used; other CUDA GPUs fall back to FlashAttention-2 or PyTorch SDPA.
  • CUDA toolkit 12.4 (matches the pinned torch==2.5.1+cu124 ; 12.3+ is the minimum if you build FlashAttention-3).
  • Pinned in requirements.txt : torch==2.5.1+cu124 , diffusers==0.35.2 , accelerate==0.34.2 , transformers==4.57.3 .

Reference environment (Bernini-R is developed and tested on this setup):

Component Version
GPU NVIDIA H100
CUDA 12.4
Python 3.11.2
PyTorch 2.5.1+cu124
Install
git clone https://github.com/bytedance/Bernini.git bernini && cd bernini
pip install -r requirements.txt

Optional extras:

  • Multi-GPU sequence parallel needs Open-VeOmni (Apache-2.0, Python 3.11). Use --no-deps so VeOmni does not pull in a different torch build and override the pinned torch==2.5.1+cu124 : pip install --no-deps git+https://github.com/ByteDance-Seed/[email protected] . Single-GPU inference does not need it.
  • Faster attention (auto-detected if installed; otherwise PyTorch SDPA is used):
    • FlashAttention-2 — general CUDA GPUs (incl. A100/A800): pip install flash-attn==2.8.3 .
    • FlashAttention-3 — Hopper only (H100/H800/H200, CUDA ≥ 12.3, PyTorch ≥ 2.4). flash_attn_interface is not on PyPI; build it from the flash-attention repo's hopper/ directory at tag v2.8.3 :
      git clone https://github.com/Dao-AILab/flash-attention.git
      cd flash-attention && git checkout v2.8.3
      cd hopper && MAX_JOBS=$(nproc) python3 setup.py install --user
      
Weights

Bernini-R provides two ways to obtain the renderer weights. The diffusers format is recommended — it is a self-contained diffusers-format directory whose transformer / transformer_2 already hold the Bernini-R weights, so you point --config at it and the weights load directly, with no --high_noise_ckpt / --low_noise_ckpt needed.

Option A — diffusers format (recommended)

A single ready-to-use diffusers-format model from ByteDance/Bernini-R-Diffusers . It bundles the Wan2.2 base components (VAE, UMT5 text encoder, tokenizer) together with the Bernini-R transformer weights, so nothing else is downloaded at runtime.

pip install -U "huggingface_hub"
hf download ByteDance/Bernini-R-Diffusers --local-dir Bernini-R-Diffusers

Then pass it via --config and omit the checkpoint flags, e.g.:

python infer_single_gpu.py --config Bernini-R-Diffusers \
    --case assets/testcases/t2i/t2i.json --num_frames 1
Option B — separate checkpoints

The original layout, where Bernini-R uses two sets of weights loaded separately:

  1. Wan2.2 base Wan-AI/Wan2.2-T2V-A14B-Diffusers on Hugging Face. Supplies the VAE, UMT5 text encoder, tokenizer, and the transformer architecture/base weights. It is downloaded automatically on first run (configured by wan22_base in configs/bernini_renderer_wan22/config.json ).
  2. Bernini-R checkpoint — the trained high-noise / low-noise transformer weights (safetensors) from ByteDance/Bernini-R , passed with --high_noise_ckpt / --low_noise_ckpt . Both a local directory and a Hugging Face repo id are accepted.

Download models using huggingface-cli:

pip install -U "huggingface_hub"
hf download Wan-AI/Wan2.2-T2V-A14B-Diffusers --local-dir Wan2.2-T2V-A14B-Diffusers
hf download ByteDance/Bernini-R --local-dir Bernini-R
🚀 Usage

A run is described by a case file — a small JSON under assets/testcases/ that bundles one task's routing and inputs ( task_type , guidance_mode , prompt , source media, output ). This keeps long prompts out of the command line. Each task has a directory under assets/testcases/ holding one or more case files; see assets/testcases/ for the format and the bundled t2i / i2i / t2v / v2v / rv2v / r2v examples.

Prompt enhancer (highly recommended)

--use_pe enhances the prompt through an OpenAI-compatible endpoint and is recommended for best generation quality. The openai SDK is installed by requirements.txt ; configure the endpoint with environment variables:

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
Examples by task type

Unless an example specifies otherwise, inference outputs 480p / 16fps (the defaults — --max_image_size 848 , --fps 16 ).

Each example runs a bundled case in assets/testcases/ — replace <hi> / <lo> with your high-/low-noise checkpoint paths. The image tasks ( t2i , i2i ) are shown on a single GPU; the video tasks on 8 GPUs via torchrun , where --ulysses N gives N-way Ulysses sequence parallel per sample and the remaining world_size / N ranks run data parallel over the task list. The two scripts take the same inputs, so any example can be run either way.

Inputs can also be passed directly as flags instead of --case ( --prompt , --task_type , --guidance_mode , --video , --image , --images , --output ); generation parameters ( --seed , --num_frames , ...) are always command-line flags.

Text-to-image ( t2i ) — single GPU; generates one frame, so pass --num_frames 1

python infer_single_gpu.py --high_noise_ckpt <hi> --low_noise_ckpt <lo> \
    --case assets/testcases/t2i/t2i.json --num_frames 1

Image editing ( i2i ) — single GPU; generates one frame, so pass --num_frames 1

python infer_single_gpu.py --high_noise_ckpt <hi> --low_noise_ckpt <lo> \
    --case assets/testcases/i2i/i2i.json --num_frames 1

Text-to-video ( t2v )

torchrun --nproc-per-node 8 infer_multi_gpu.py \
    --high_noise_ckpt <hi> --low_noise_ckpt <lo> --ulysses 8 \
    --case assets/testcases/t2v/t2v.json

Video editing ( v2v / mv2v ) — two cases are provided.

For edits where the main subject keeps its ordinary motion (case 1 adds a snowman to the scene), the v2v task type is enough:

torchrun --nproc-per-node 8 infer_multi_gpu.py \
    --high_noise_ckpt <hi> --low_noise_ckpt <lo> --ulysses 8 \
    --case assets/testcases/v2v/v2v_case1.json

For edits that need to change the subject's motion (case 2 makes the person crouch down), the mv2v task type gives better results:

torchrun --nproc-per-node 8 infer_multi_gpu.py \
    --high_noise_ckpt <hi> --low_noise_ckpt <lo> --ulysses 8 \
    --case assets/testcases/v2v/v2v_case2.json

Reference + video editing ( rv2v ) — two cases are provided.

Case 1 is reference-image-guided video editing — replacing a garment in the source video with one from a reference image:

torchrun --nproc-per-node 8 infer_multi_gpu.py \
    --high_noise_ckpt <hi> --low_noise_ckpt <lo> --ulysses 8 \
    --case assets/testcases/rv2v/rv2v_case1.json

Case 2 is a video-insertion example — inserting content into the source video. It is run at 720p / 24fps to show the insertion result more clearly:

torchrun --nproc-per-node 8 infer_multi_gpu.py \
    --high_noise_ckpt <hi> --low_noise_ckpt <lo> --ulysses 8 \
    --case assets/testcases/rv2v/rv2v_case2.json \
    --num_frames 121 --fps 24 --max_image_size 1280

Reference-to-video ( r2v ) — drives a video from one or more reference images

torchrun --nproc-per-node 8 infer_multi_gpu.py \
    --high_noise_ckpt <hi> --low_noise_ckpt <lo> --ulysses 8 \
    --case assets/testcases/r2v/r2v.json

See python infer_single_gpu.py --help for the full argument list.

Gradio demo

gradio_demo.py exposes the same pipeline through a Gradio UI: the task-type dropdown auto-fills guidance_mode (still user-editable), uploaded media is routed to the matching slot, and the result is rendered inline.

# Single GPU
python gradio_demo.py --high_noise_ckpt <hi> --low_noise_ckpt <lo> --port 7860

# 8 GPUs, 8-way Ulysses sequence parallel
torchrun --nproc-per-node 8 gradio_demo.py --ulysses 8 \
    --high_noise_ckpt <hi> --low_noise_ckpt <lo> --port 7860 --share

Add --use_pe (and export OPENAI_API_KEY=... / BERNINI_PE_API_KEY=... ) to enable GPT prompt enhancement; the in-UI checkbox is a per-request switch on top of this flag.

📑 Citation

If you use Bernini in your research, please cite:

@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:

We thank the authors and communities of these projects for their contributions.

📄 License

Apache License 2.0. See LICENSE .

Runs of ByteDance Bernini-R-Diffusers on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About Bernini-R-Diffusers huggingface.co Model

More Bernini-R-Diffusers license Visit here:

https://choosealicense.com/licenses/apache-2.0

Bernini-R-Diffusers huggingface.co

Bernini-R-Diffusers huggingface.co is an AI model on huggingface.co that provides Bernini-R-Diffusers's model effect (), which can be used instantly with this ByteDance Bernini-R-Diffusers model. huggingface.co supports a free trial of the Bernini-R-Diffusers model, and also provides paid use of the Bernini-R-Diffusers. Support call Bernini-R-Diffusers model through api, including Node.js, Python, http.

Bernini-R-Diffusers huggingface.co Url

https://huggingface.co/ByteDance/Bernini-R-Diffusers

ByteDance Bernini-R-Diffusers online free

Bernini-R-Diffusers huggingface.co is an online trial and call api platform, which integrates Bernini-R-Diffusers's modeling effects, including api services, and provides a free online trial of Bernini-R-Diffusers, you can try Bernini-R-Diffusers online for free by clicking the link below.

ByteDance Bernini-R-Diffusers online free url in huggingface.co:

https://huggingface.co/ByteDance/Bernini-R-Diffusers

Bernini-R-Diffusers install

Bernini-R-Diffusers is an open source model from GitHub that offers a free installation service, and any user can find Bernini-R-Diffusers on GitHub to install. At the same time, huggingface.co provides the effect of Bernini-R-Diffusers install, users can directly use Bernini-R-Diffusers installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Bernini-R-Diffusers install url in huggingface.co:

https://huggingface.co/ByteDance/Bernini-R-Diffusers

Url of Bernini-R-Diffusers

Bernini-R-Diffusers huggingface.co Url

Provider of Bernini-R-Diffusers huggingface.co

ByteDance
ORGANIZATIONS

Other API from ByteDance

huggingface.co

Total runs: 51.2K
Run Growth: -1.2K
Growth Rate: -2.45%
Updated:December 05 2024
huggingface.co

Total runs: 32.2K
Run Growth: -35.8K
Growth Rate: -111.33%
Updated:January 19 2026
huggingface.co

Total runs: 9.3K
Run Growth: -2.0K
Growth Rate: -21.22%
Updated:January 19 2026
huggingface.co

Total runs: 1.1K
Run Growth: 924
Growth Rate: 81.20%
Updated:November 28 2025
huggingface.co

Total runs: 793
Run Growth: -927
Growth Rate: -116.90%
Updated:September 08 2025
huggingface.co

Total runs: 541
Run Growth: 204
Growth Rate: 37.71%
Updated:November 12 2025
huggingface.co

Total runs: 517
Run Growth: -1.1K
Growth Rate: -220.89%
Updated:December 12 2025
huggingface.co

Total runs: 489
Run Growth: 128
Growth Rate: 26.18%
Updated:September 08 2025
huggingface.co

Total runs: 441
Run Growth: -184
Growth Rate: -41.72%
Updated:July 16 2025
huggingface.co

Total runs: 384
Run Growth: -180
Growth Rate: -46.88%
Updated:September 08 2025
huggingface.co

Total runs: 311
Run Growth: 133
Growth Rate: 42.77%
Updated:April 04 2025
huggingface.co

Total runs: 193
Run Growth: -273
Growth Rate: -141.45%
Updated:June 10 2026
huggingface.co

Total runs: 151
Run Growth: -184
Growth Rate: -121.85%
Updated:June 02 2026
huggingface.co

Total runs: 112
Run Growth: 17
Growth Rate: 15.18%
Updated:September 08 2025
huggingface.co

Total runs: 64
Run Growth: 23
Growth Rate: 76.67%
Updated:April 22 2025
huggingface.co

Total runs: 49
Run Growth: 7
Growth Rate: 14.29%
Updated:July 01 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 26 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 11 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 02 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 01 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 27 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 05 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:June 24 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 13 2026