jennyxue commited on
Commit
7ee4f4e
·
verified ·
1 Parent(s): ff9cdf5

Model card and the original license

Browse files
Files changed (1) hide show
  1. README.md +80 -0
README.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: hustvl/Moebius
3
+ base_model_relation: quantized
4
+ license: mit
5
+ pipeline_tag: image-to-image
6
+ library_name: mlx
7
+ tags:
8
+ - mlx
9
+ - moonbox
10
+ - moebius
11
+ - inpainting
12
+ - object-removal
13
+ ---
14
+
15
+ # Moebius MLX
16
+
17
+ MLX builds of [Moebius](https://huggingface.co/hustvl/Moebius), made by Moonbox for Apple Silicon Macs. Each precision is a folder; keep a folder's
18
+ files together. Only the parts listed below are converted: the rest of the pipeline comes from the original
19
+ repository unless the section below says otherwise.
20
+
21
+ ## Files
22
+
23
+ The last column is how far each build is from the original PyTorch model on the same inputs (see the section below
24
+ for what was measured).
25
+
26
+ | Precision | File | Size | sha256 | Checked against the original |
27
+ |---|---|---|---|---|
28
+ | fp16 | [`fp16/temb.npz`](https://huggingface.co/moonbox-ai/Moebius-MLX/blob/main/fp16/temb.npz) | 5.1 MB | `b5b4a28cb0ba` | PSNR 41.0 dB mean / 33.9 worst, LPIPS <= 0.008 |
29
+ | fp16 | [`fp16/unet.safetensors`](https://huggingface.co/moonbox-ai/Moebius-MLX/blob/main/fp16/unet.safetensors) | 476.8 MB | `e75b9e1549e4` | PSNR 41.0 dB mean / 33.9 worst, LPIPS <= 0.008 |
30
+ | fp16 | [`fp16/vae.safetensors`](https://huggingface.co/moonbox-ai/Moebius-MLX/blob/main/fp16/vae.safetensors) | 167.3 MB | `81593a7667f4` | PSNR 41.0 dB mean / 33.9 worst, LPIPS <= 0.008 |
31
+
32
+ ## How to run
33
+
34
+ Moebius (the `pretrained` general model) with the PixelHacker VAE, converted for the MLX port in Moonbox's Moebius
35
+ engine. Each folder holds:
36
+
37
+ | File | What |
38
+ |---|---|
39
+ | `unet.safetensors` | the 0.22 B UNet: BatchNorms, norm affines and the constant conditioning folded into the weights; 1x1 convs and attention projections stored as `[in, out]` matrices (MLX affine-quantized, group 64, in the `8bit` / `6bit` / `4bit` folders: `<name>.q`, `.scales`, `.biases`) |
40
+ | `vae.safetensors` | PixelHacker's VAE (fp16 in the quantized folders) |
41
+ | `temb.npz` | `silu(time_embedding(t))` for t = 0..999 |
42
+
43
+ The layout is the one `moebius_od/mlx_unet.py` and `mlx_vae.py` in Moonbox read (NHWC, 512x512, 20 DDIM steps, CFG 2,
44
+ as upstream's README). That runtime isn't part of this repository.
45
+
46
+ **How they were checked.** Through the same MLX engine against the float32 weights, removing the main subject of 8
47
+ photos (seed 0): PSNR and LPIPS of the 512 px output. Pass: LPIPS <= 0.15 on every image. The MLX port itself was
48
+ checked against the official PyTorch pipeline when the engine was written.
49
+
50
+ | Precision | Size | PSNR vs float32 (mean / worst) | LPIPS (worst) | Status |
51
+ |---|---|---|---|---|
52
+ | `fp16/` | 649 MB | 41.0 / 33.9 dB | 0.008 | passes |
53
+ | `bf16/` | 649 MB | 32.2 / 27.2 dB | 0.050 | passes |
54
+ | `8bit/` | 495 MB | 37.4 / 33.0 dB | 0.022 | passes |
55
+ | `6bit/` | 453 MB | 32.9 / 26.4 dB | 0.066 | passes |
56
+ | `4bit/` | 412 MB | 22.4 / 16.7 dB | 0.380 | **below threshold, experimental** |
57
+
58
+ About 4-5 s per inpainting (20 steps, 512 px) on an Apple M5.
59
+
60
+ ## How these were made
61
+
62
+ From [Moebius](https://huggingface.co/hustvl/Moebius) at revision `cd01f47fb6`: the original weights loaded in MLX and stored as bf16 or fp16, or
63
+ quantized with MLX's affine quantization (`8bit`, `6bit`, `4bit`, group size 64; layers MLX can't quantize, such as
64
+ convolutions and norms, stay bf16). Every build was checked against the original before upload; the `sha256` column
65
+ above is what the files must hash to.
66
+
67
+ ## License
68
+
69
+ Apache-2.0. These files are a derivative of the original model and carry its license: it is copied in this
70
+ repository, and it governs your use of these files. The original model card follows unchanged.
71
+
72
+ ---
73
+
74
+ # Original model card
75
+
76
+ 《Moebius: 0.2B Lightweight Image Inpainting Framework with 10B-Level Performance》
77
+ Project Page: https://hustvl.github.io/Moebius
78
+ Paper: https://arxiv.org/abs/2606.19195
79
+ Code: https://github.com/hustvl/Moebius
80
+ weight: https://huggingface.co/hustvl/Moebius/tree/main