File size: 2,726 Bytes
22f491b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
base_model: ByteDance-Seed/SeedVR2-7B
pipeline_tag: image-to-image
library_name: mlx-gen
tags:
- mlx
- mlx-gen
- mflux
- apple-silicon
- 4-bit
- seedvr2
- image-upscaling
- super-resolution
---
# seedvr2-7b-4bit

This repository contains MLX-Gen saved weights for `ByteDance-Seed/SeedVR2-7B`. The checkpoint is designed for local Apple Silicon inference with [`mlx-gen`](https://github.com/lpalbou/mlx-gen).

It uses the mflux/MLX saved-weight layout. Quantized checkpoints include MLX quantization tensors. It is not a Diffusers or Transformers `from_pretrained()` checkpoint.

## Source Model

Original model: [`ByteDance-Seed/SeedVR2-7B`](https://huggingface.co/ByteDance-Seed/SeedVR2-7B).

## License and Access

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

## Quantization

This is an MLX 4-bit checkpoint for SeedVR2 7B image super-resolution.

- q4 for quantizable SeedVR2 transformer linears and VAE attention linears.
- BF16 for convolutions, normalization layers, and other non-quantizable parameters.
- The static SeedVR2 positive embedding is provided by the MLX-Gen runtime.

See the [MLX-Gen quantization docs](https://github.com/lpalbou/mlx-gen/blob/main/docs/quantization.md) for compatibility notes and measured behavior.

## Validation

Measured on an Apple M5 Max with 128 GB unified memory using `mlx-gen 0.18.13`.
The profile upscales `docs/assets/upscaling/seedvr2-5x-source.jpg` from `133x113`
to `658x560` with `--resolution 5x --seed 42 --metadata`.

| Package | Storage | Generation time | Wall time | Max RSS |
| --- | ---: | ---: | ---: | ---: |
| `ByteDance-Seed/SeedVR2-7B` source generation files | 31.63 GiB | 2.64 s | 8.69 s | 61.62 GiB |
| `AbstractFramework/seedvr2-7b-4bit` | 4.79 GiB | 2.21 s | 3.24 s | 5.10 GiB |

See the [SeedVR2 upscaling guide](https://github.com/lpalbou/mlx-gen/blob/main/docs/upscaling.md)
for the 3B/7B source, q8, and q4 comparison sheet generated from this profile.

## Compatibility

Requires `mlx-gen >= 0.18.13`.

Generated with `mlx-gen 0.18.13`.

Use `mlxgen download` and `mlxgen upscale` for this SeedVR2 package.

## Usage

```bash
python -m pip install -U mlx-gen

mlxgen download --model AbstractFramework/seedvr2-7b-4bit

mlxgen upscale \
  --model AbstractFramework/seedvr2-7b-4bit \
  --image-path input.png \
  --resolution 2x \
  --seed 42 \
  --metadata \
  --output upscaled.png
```

## Attribution

MLX-Gen is based on [mflux](https://github.com/filipstrand/mflux) by Filip Strand and the original mflux contributors. This model card is generated by MLX-Gen so derived checkpoints keep that attribution visible.

Quantized and contributed by [@lpalbou](https://huggingface.co/lpalbou).