File size: 2,468 Bytes
e7406dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09e82f8
e7406dc
 
09e82f8
 
e7406dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
09e82f8
 
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
---
license: apache-2.0
base_model: ByteDance/Bernini-R-1.3B-Diffusers
pipeline_tag: image-to-video
library_name: mlx-gen
tags:
- mlx
- mlx-gen
- mflux
- apple-silicon
- bf16
- bernini
- wan
- video-generation
- video-editing
- reference-to-video
---
# bernini-r-1.3b-diffusers-bf16

This repository contains a BF16 repack of
[`ByteDance/Bernini-R-1.3B-Diffusers`](https://huggingface.co/ByteDance/Bernini-R-1.3B-Diffusers)
for local Apple Silicon inference with
[`mlx-gen`](https://github.com/lpalbou/mlx-gen).

The source repository ships FP32 weights (~27 GiB) that inference runtimes cast to BF16 at load
time. This repack stores the runtime dtypes directly, reducing the download to ~15.6 GiB (42% smaller) with no
change in output:

- UMT5 text encoder: BF16, with the `wo` feed-forward projections stored in FP32 exactly as
  the runtime keeps them (`_keep_in_fp32_modules`).
- Renderer transformer: BF16, with the runtime FP32 keep-set (norms, scale-shift tables, and
  embedding layers) stored in FP32 exactly as the loader produces them.
- VAE: FP32, unchanged.
- Tokenizer, scheduler, and configs: unchanged.

The repository keeps the upstream Diffusers layout, so it also remains loadable by the official
Bernini inference code.

## Source Model

Original model: [`ByteDance/Bernini-R-1.3B-Diffusers`](https://huggingface.co/ByteDance/Bernini-R-1.3B-Diffusers).

This derivative follows the Apache 2.0 license of the source model.

## Usage With mlx-gen

```sh
mlxgen download --model bernini-r-1.3b-bf16

mlxgen generate \
  --model bernini-r-1.3b-bf16 \
  --reference-image subject.png \
  --prompt "Bring the subject from image0 to life in a fixed medium shot" \
  --width 848 --height 480 --frames 81 --fps 16 --steps 40 \
  --seed 42 --output referenced.mp4
```

Bernini-R supports reference-to-video (1-8 reference images), reference-guided video editing
(`--video` plus references), and prompt-guided video editing (`--video` only). See the
[mlx-gen Bernini documentation](https://github.com/lpalbou/mlx-gen/blob/main/docs/bernini.md)
for workflows, guidance defaults, and task-specific recipes.

## Fidelity

Tensors are bit-exact casts of the pinned source revision
(`ff4c5d4d2d31365c2ffeb30e9753065ee18f58ce`): every tensor equals the value the mlx-gen loader
produces from the FP32 original, and generation output was verified bit-identical to the source
repository on image and video use cases at the same settings and seed (max pixel diff 0).