MOSS-Image-SFT-MLX / README.md
jennyxue's picture
Model card and the original license
27e8412 verified
|
Raw History Blame Contribute Delete
27.7 kB
---
base_model: OpenMOSS-Team/MOSS-Image-SFT
base_model_relation: quantized
license: apache-2.0
pipeline_tag: text-to-image
library_name: mlx
tags:
- mlx
- moonbox
- moss-image
- text-to-image
- diffusion-single-file
---
# MOSS-Image (SFT) MLX
MLX builds of [MOSS-Image (SFT)](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT), made by Moonbox for Apple Silicon Macs. Each precision is a folder; keep a folder's
files together. Only the parts listed below are converted: the rest of the pipeline comes from the original
repository unless the section below says otherwise.
## Files
The last column is how far each build is from the original PyTorch model on the same inputs (see the section below
for what was measured).
| Precision | File | Size | sha256 | Checked against the original |
|---|---|---|---|---|
| bf16 | [`bf16/mflux_model.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/mflux_model.json) | 0.4 kB | `afa4f3c20233` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/0.safetensors) | 2.13 GB | `9be8575f9978` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/1.safetensors) | 2.10 GB | `76826c2512c5` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/2.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/2.safetensors) | 2.13 GB | `d143078bfed0` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/3.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/3.safetensors) | 2.07 GB | `86de523b1bb7` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/4.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/4.safetensors) | 2.05 GB | `3cf868fb3c34` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/5.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/5.safetensors) | 2.07 GB | `90b728c34f6c` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/6.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/6.safetensors) | 2.13 GB | `7ab6019f987b` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/7.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/7.safetensors) | 1.19 GB | `3e67006774cf` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/text_encoder/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/text_encoder/model.safetensors.index.json) | 25.0 kB | `d7e73ca28859` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/tokenizer/chat_template.jinja`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/tokenizer/chat_template.jinja) | 7.8 kB | `a4aee8afcf2e` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/tokenizer/tokenizer.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/tokenizer/tokenizer.json) | 20.0 MB | `06b9509352d2` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/tokenizer/tokenizer_config.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/tokenizer/tokenizer_config.json) | 1.1 kB | `bee8eba30f0e` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/transformer/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/transformer/0.safetensors) | 2.05 GB | `ff269e76dc5d` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/transformer/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/transformer/1.safetensors) | 2.14 GB | `ad1e65cda935` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/transformer/2.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/transformer/2.safetensors) | 2.15 GB | `961108991d7c` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/transformer/3.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/transformer/3.safetensors) | 2.06 GB | `9d9d213a41be` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/transformer/4.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/transformer/4.safetensors) | 1.78 GB | `d255a1280146` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/transformer/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/transformer/model.safetensors.index.json) | 23.2 kB | `d8a42a87e429` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/vae/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/vae/0.safetensors) | 124.8 MB | `2bc64e7a50c9` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | [`bf16/vae/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/bf16/vae/model.safetensors.index.json) | 16.5 kB | `009c1b40da60` | the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| 8bit | [`8bit/mflux_model.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/mflux_model.json) | 0.4 kB | `fbcbab761a9e` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/text_encoder/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/text_encoder/0.safetensors) | 2.12 GB | `1d0f2fe9431d` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/text_encoder/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/text_encoder/1.safetensors) | 2.12 GB | `265058f714e6` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/text_encoder/2.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/text_encoder/2.safetensors) | 2.12 GB | `1c7d9942f7e6` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/text_encoder/3.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/text_encoder/3.safetensors) | 2.06 GB | `f995a4eba76a` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/text_encoder/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/text_encoder/model.safetensors.index.json) | 54.2 kB | `cfc820f65807` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/tokenizer/chat_template.jinja`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/tokenizer/chat_template.jinja) | 7.8 kB | `a4aee8afcf2e` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/tokenizer/tokenizer.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/tokenizer/tokenizer.json) | 20.0 MB | `06b9509352d2` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/tokenizer/tokenizer_config.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/tokenizer/tokenizer_config.json) | 1.1 kB | `bee8eba30f0e` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/transformer/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/transformer/0.safetensors) | 2.14 GB | `9425d5e4f39f` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/transformer/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/transformer/1.safetensors) | 2.13 GB | `9b83123ef826` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/transformer/2.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/transformer/2.safetensors) | 1.13 GB | `c3a91a1c7e35` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/transformer/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/transformer/model.safetensors.index.json) | 50.6 kB | `c385aa22daff` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/vae/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/vae/0.safetensors) | 123.2 MB | `2fd063835fd5` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | [`8bit/vae/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/8bit/vae/model.safetensors.index.json) | 17.5 kB | `4d629a6165dd` | vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 6bit | [`6bit/mflux_model.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/mflux_model.json) | 0.4 kB | `193edbeac0db` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/text_encoder/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/text_encoder/0.safetensors) | 2.15 GB | `5dc48f61e4ec` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/text_encoder/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/text_encoder/1.safetensors) | 2.11 GB | `a6d44163bb07` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/text_encoder/2.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/text_encoder/2.safetensors) | 2.15 GB | `fa3e70633240` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/text_encoder/3.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/text_encoder/3.safetensors) | 44.1 MB | `8d89a3f57f13` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/text_encoder/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/text_encoder/model.safetensors.index.json) | 54.2 kB | `9885f1ccb02a` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/tokenizer/chat_template.jinja`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/tokenizer/chat_template.jinja) | 7.8 kB | `a4aee8afcf2e` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/tokenizer/tokenizer.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/tokenizer/tokenizer.json) | 20.0 MB | `06b9509352d2` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/tokenizer/tokenizer_config.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/tokenizer/tokenizer_config.json) | 1.1 kB | `bee8eba30f0e` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/transformer/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/transformer/0.safetensors) | 2.12 GB | `f6806ca18303` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/transformer/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/transformer/1.safetensors) | 2.01 GB | `f758e35a9020` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/transformer/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/transformer/model.safetensors.index.json) | 50.6 kB | `2cbc94582e51` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/vae/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/vae/0.safetensors) | 122.8 MB | `bb30345b410e` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | [`6bit/vae/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/6bit/vae/model.safetensors.index.json) | 17.5 kB | `a5a21d176b96` | vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 4bit | [`4bit/mflux_model.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/mflux_model.json) | 0.4 kB | `ec9428aa8f27` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/text_encoder/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/text_encoder/0.safetensors) | 2.13 GB | `3d461b13a81f` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/text_encoder/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/text_encoder/1.safetensors) | 2.14 GB | `6f8e09165bca` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/text_encoder/2.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/text_encoder/2.safetensors) | 202.9 MB | `56de27e47826` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/text_encoder/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/text_encoder/model.safetensors.index.json) | 54.2 kB | `bd366e569b0b` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/tokenizer/chat_template.jinja`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/tokenizer/chat_template.jinja) | 7.8 kB | `a4aee8afcf2e` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/tokenizer/tokenizer.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/tokenizer/tokenizer.json) | 20.0 MB | `06b9509352d2` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/tokenizer/tokenizer_config.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/tokenizer/tokenizer_config.json) | 1.1 kB | `bee8eba30f0e` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/transformer/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/transformer/0.safetensors) | 2.15 GB | `ce2b196b2dba` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/transformer/1.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/transformer/1.safetensors) | 712.5 MB | `147842364c26` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/transformer/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/transformer/model.safetensors.index.json) | 50.6 kB | `1a400badd1dd` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/vae/0.safetensors`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/vae/0.safetensors) | 122.4 MB | `3737818da953` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
| 4bit | [`4bit/vae/model.safetensors.index.json`](https://huggingface.co/moonbox-ai/MOSS-Image-SFT-MLX/blob/main/4bit/vae/model.safetensors.index.json) | 17.5 kB | `e396f8330c32` | below threshold (experimental), vs bf16: PSNR 17.0 dB, LPIPS 0.273 mean / 0.292 worst |
## How to run
Each folder is the whole pipeline (Qwen3.5 text encoder, transformer, FLUX.2 VAE, tokenizer) saved by
[mflux](https://github.com/filipstrand/mflux) 0.24.0 from the original weights at the revision below. Run it with
mflux:
```bash
pip install mflux==0.24.0
hf download moonbox-ai/MOSS-Image-SFT-MLX --include "8bit/*" --local-dir moss
mflux-generate-moss-image --model moss/8bit --base-model moss-image-sft \
--prompt "A red fox in fresh snow at sunrise, photo" --width 1024 --height 1024 --seed 7 --output fox.png
```
`8bit/`, `6bit/` and `4bit/` quantize the transformer's and the text encoder's linear layers (MLX affine, group size
64); the VAE stays bf16. No fp16 folder: mflux computes in bf16 whatever the weights are.
**How they were checked.** Each quantized pipeline against `bf16/` from the *same* initial noise, 3 prompts at
512x512, mflux's default steps. Pass: LPIPS <= 0.15 on every prompt. `bf16/` itself is the original weights in bf16;
it wasn't compared with a PyTorch run (diffusers has no MOSS-Image pipeline).
| Precision | Size | PSNR vs bf16 (mean) | LPIPS (mean / worst) | Status |
|---|---|---|---|---|
| `bf16/` | 26.2 GB | reference | - | the original weights |
| `8bit/` | 14.0 GB | 36.0 dB | 0.011 / 0.014 | passes |
| `6bit/` | 10.7 GB | 28.1 dB | 0.038 / 0.044 | passes |
| `4bit/` | 7.5 GB | 17.0 dB | 0.273 / 0.292 | **below threshold, experimental** |
About 2.5 minutes per 512x512 picture on an Apple M5 with 24 GB at mflux's defaults.
## How these were made
From [MOSS-Image (SFT)](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT) at revision `f972bd4b4b`: the original weights loaded in MLX and stored as bf16 or fp16, or
quantized with MLX's affine quantization (`8bit`, `6bit`, `4bit`, group size 64; layers MLX can't quantize, such as
convolutions and norms, stay bf16). Every build was checked against the original before upload; the `sha256` column
above is what the files must hash to.
## License
Apache-2.0. These files are a derivative of the original model and carry its license: it is copied in this
repository, and it governs your use of these files. The original model card follows unchanged.
---
# Original model card
# MOSS-Image-SFT
<div align="center">
<p>
<a href="https://github.com/OpenMOSS/MOSS-Image">
<img class="dark:hidden mx-auto" src="assets/lockup-light.svg" alt="MOSS-Image" width="520">
<img class="hidden dark:block mx-auto" src="assets/lockup-dark.svg" alt="MOSS-Image" width="520">
</a>
</p>
<p>
<a href="https://huggingface.co/OpenMOSS-Team/MOSS-Image-Base"><img alt="Hugging Face · MOSS-Image-Base" src="https://img.shields.io/badge/🤗%20Hugging%20Face-MOSS--Image--Base-ffc107?style=flat-square"></a>
&nbsp;
<a href="https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT"><img alt="Hugging Face · MOSS-Image-SFT" src="https://img.shields.io/badge/🤗%20Hugging%20Face-MOSS--Image--SFT-ffc107?style=flat-square"></a>
&nbsp;
<a href="https://modelscope.cn/models/openmoss/MOSS-Image-Base"><img alt="ModelScope · MOSS-Image-Base" src="assets/modelscope-base-badge.svg"></a>
&nbsp;
<a href="https://modelscope.cn/models/openmoss/MOSS-Image-SFT"><img alt="ModelScope · MOSS-Image-SFT" src="assets/modelscope-sft-badge.svg"></a>
&nbsp;
<a href="https://github.com/OpenMOSS/MOSS-Image"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Code-181717?style=flat-square&amp;logo=github&amp;logoColor=white"></a>
&nbsp;
<a href="https://huggingface.co/spaces/OpenMOSS-Team/MOSS-Image"><img alt="Hugging Face Spaces · Demo" src="https://img.shields.io/badge/🤗%20Spaces-Demo-4f46e5?style=flat-square"></a>
&nbsp;
<a href="https://platform.mosi.cn/?utm_source=huggingface&amp;utm_medium=readme&amp;utm_campaign=imageapi"><img alt="MOSI API Platform" src="https://img.shields.io/badge/🔌%20MOSI-API%20Platform-0f766e?style=flat-square"></a>
&nbsp;
<a href="https://openmoss.github.io/MOSS-Image/"><img alt="Homepage" src="https://img.shields.io/badge/🌐%20Project-Homepage-2563eb?style=flat-square"></a>
&nbsp;
<a href="https://github.com/OpenMOSS/MOSS-Image/blob/main/paper/MOSS_Image_Technical_Report.pdf"><img alt="Technical Report" src="https://img.shields.io/badge/📄%20Paper-Technical_Report-b31b1b?style=flat-square"></a>
&nbsp;
<a href="https://arxiv.org/abs/2610.23374"><img alt="arXiv: 2610.23374" src="https://img.shields.io/badge/arXiv-2610.23374-b31b1b?style=flat-square&amp;logo=arxiv&amp;logoColor=white"></a>
&nbsp;
<a href="https://x.com/Open_MOSS"><img alt="Follow OpenMOSS on X" src="https://img.shields.io/badge/Follow-OpenMOSS-000000?style=flat-square&amp;logo=x&amp;logoColor=white"></a>
&nbsp;
<a href="https://qm.qq.com/q/hphM7VhaDu"><img alt="MOSS-Image QQ 交流群:755535143" src="https://img.shields.io/badge/QQ-755535143-12B7F5?style=flat-square&amp;logo=qq&amp;logoColor=white"></a>
&nbsp;
<a href="https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=7a3m2007-815f-409b-9c3d-a4129f5c058e"><img alt="MOSS-Builders Feishu Community" src="assets/feishu-builders-badge.svg"></a>
&nbsp;
<a href="https://discord.gg/nXFWEyvbb"><img alt="MOSS-Image Discord Community" src="https://img.shields.io/badge/Discord-Community-5865F2?style=flat-square&amp;logo=discord&amp;logoColor=white"></a>
</p>
<p>
<a href="https://github.com/OpenMOSS/MOSS-Image/blob/main/USERGUIDE.md">User guide</a> &nbsp; · &nbsp;
<a href="https://github.com/OpenMOSS/MOSS-Image/blob/main/USERGUIDE_ZH.md">中文用户指南</a> &nbsp; · &nbsp;
<a href="https://github.com/OpenMOSS/MOSS-Image/blob/main/comfyui/README.md">ComfyUI</a>
</p>
</div>
![MOSS-Image-Base and MOSS-Image-SFT](assets/teaser.webp)
MOSS-Image-SFT is a supervised fine-tuned text-to-image model in the
**MOSS-Image** family from OpenMOSS, derived from
[MOSS-Image-Base](https://huggingface.co/OpenMOSS-Team/MOSS-Image-Base).
It uses the same architecture and inference pipeline, supporting natural-language
prompts, tag sequences, and JSON layouts for controlling text placement and
object arrangement.
## Base vs. SFT
In this example, SFT produces clearer text grouping and a more organized whiteboard layout.
| MOSS-Image-Base | MOSS-Image-SFT |
| --- | --- |
| ![MOSS-Image-Base](assets/comparison/base.webp) | ![MOSS-Image-SFT](assets/comparison/sft.webp) |
## Quick start
Use Python 3.10 or later and an NVIDIA GPU with CUDA support. Install a PyTorch
2.9 or later build compatible with your CUDA environment, then install:
```bash
pip install "diffusers>=0.38" "transformers>=5.3" "accelerate>=1.10" "safetensors>=0.6" "Pillow>=10"
```
```python
import torch
from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained(
"OpenMOSS-Team/MOSS-Image-SFT",
custom_pipeline="pipeline_moss_image",
trust_remote_code=True,
torch_dtype={"default": torch.bfloat16, "vae": torch.float32},
)
pipe.scheduler = type(pipe.scheduler).from_config(pipe.scheduler.config)
pipe.to("cuda")
prompt = '''A wide view of a refrigerator beside a kitchen counter with a fruit bowl. A small sticky note on the refrigerator door is handwritten in Chinese:
"记得买牛奶和鸡蛋!
牛奶两盒,鸡蛋一打。
顺便带一袋面包。"'''
image = pipe(
prompt,
height=1024,
width=1024,
num_inference_steps=50,
guidance_scale=3.0,
uncond_skip_layers=[22],
generator=torch.Generator("cpu").manual_seed(42),
).images[0]
image.save("refrigerator_note.png")
```
The model and custom pipeline code are downloaded and cached automatically. You
can also pass a complete local model directory to `from_pretrained`.
The transformer and text encoder use bfloat16; the VAE and initial noise use
float32. The bundled VAE uses the FLUX.2 small decoder.
For the Gradio interface, CPU offload, and compilation options, follow the
[project quick start](https://github.com/OpenMOSS/MOSS-Image#quick-start).
For ComfyUI, search for **MOSS-Image** in **ComfyUI Manager** to install the
native plugin. Integration into the official ComfyUI repository is in progress.
See the [installation and usage guide](https://github.com/OpenMOSS/MOSS-Image/blob/main/comfyui/README.md)
and [example workflow](https://github.com/OpenMOSS/MOSS-Image/blob/main/comfyui/moss-image/example_workflows/moss-image.json).
## Sampling settings
| Setting | Default |
| --- | --- |
| Sampler | Flow-matching Euler |
| Steps | 50 |
| CFG | 3 |
| Shift | 5 |
| Layer skipping | Negative branch, layer index 22 (zero-based) |
| Negative prompt | Empty |
The default guidance uses two transformer forwards per step. Pass
`uncond_skip_layers=[]` to disable negative-branch skipping, or set
`negative_prompt` to provide a negative prompt. Python API image dimensions must
be positive multiples of 16.
See the [user guide](https://github.com/OpenMOSS/MOSS-Image/blob/main/USERGUIDE.md)
for resolution, sampling, prompt, and LoRA training recommendations.
## Prompt enhancer skill
The [MOSS-Image Prompt Enhancer](https://github.com/OpenMOSS/MOSS-Image/blob/main/skills/moss-image-prompt-enhancer/SKILL.md) turns
image ideas into detailed captions or spatial Layout prompts. It is designed for
GPT-6-family agents with local file and Python tools. The bundled script converts
pixel-coordinate drafts into compact JSON with integer centered coordinates;
it does not call an image-generation service.
Install the [skill folder](https://github.com/OpenMOSS/MOSS-Image/tree/main/skills/moss-image-prompt-enhancer) in your agent's skills
directory, then invoke `$moss-image-prompt-enhancer` with your image idea, desired
caption or Layout output, and any canvas dimensions. Paste the compiled result
into MOSS-Image's positive prompt; for Layout, use the same generation dimensions.
## Layout-to-image generation
Pass a JSON layout as the prompt to describe the scene, rendered text, objects,
and their positions. Layouts use `summary.caption` and `items`, with
`bbox_format: "yxyx"` and `bbox_coord_space: "abs_centralized"`.
With the Python API, serialize the layout using
`json.dumps(layout, ensure_ascii=False)` and pass it to `pipe`. In Gradio, paste
the JSON into the Prompt field and set the matching image dimensions.
See the [layout format and example](https://github.com/OpenMOSS/MOSS-Image/blob/main/USERGUIDE.md#layout-prompts-experimental).
Layouts can also support controlled editing and user-friendly layout tools.
Edit text, element descriptions, and bounding boxes to adjust image content and
composition in a structured way.
![Layout control](assets/showcase/layout-bboxes.webp)
## Showcase
![Examples overview](assets/showcase/overview.webp)
![Examples overview 2](assets/showcase/overview2.webp)
## Citation
```bibtex
@misc{ai2026mossimagetechnicalreport,
title={MOSS-Image Technical Report},
author={MOSI. AI},
year={2026},
eprint={2610.23374},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2610.23374},
}
```
## License and acknowledgements
The model weights and bundled inference code are released under the
[Apache License, Version 2.0](LICENSE).
We thank the Diffusers, Qwen, and FLUX teams.