Instructions to use moonbox-ai/MOSS-Image-SFT-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use moonbox-ai/MOSS-Image-SFT-MLX with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download moonbox-ai/MOSS-Image-SFT-MLX --local-dir MOSS-Image-SFT-MLX
- Diffusion Single File
How to use moonbox-ai/MOSS-Image-SFT-MLX with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
MOSS-Image (SFT) MLX
MLX builds of 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 |
0.4 kB | afa4f3c20233 |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
2.10 GB | 76826c2512c5 |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
2.07 GB | 86de523b1bb7 |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
2.07 GB | 90b728c34f6c |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
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 |
25.0 kB | d7e73ca28859 |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
20.0 MB | 06b9509352d2 |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
2.05 GB | ff269e76dc5d |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
2.15 GB | 961108991d7c |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
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 |
23.2 kB | d8a42a87e429 |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| bf16 | 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 |
16.5 kB | 009c1b40da60 |
the original weights in bf16 (reference for the rows below; not compared with PyTorch) |
| 8bit | 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 |
2.12 GB | 1d0f2fe9431d |
vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | 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 |
2.12 GB | 1c7d9942f7e6 |
vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | 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 |
54.2 kB | cfc820f65807 |
vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | 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 |
20.0 MB | 06b9509352d2 |
vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | 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 |
2.14 GB | 9425d5e4f39f |
vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | 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 |
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 |
50.6 kB | c385aa22daff |
vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 8bit | 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 |
17.5 kB | 4d629a6165dd |
vs bf16: PSNR 36.0 dB mean, LPIPS 0.011 mean / 0.014 worst |
| 6bit | 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 |
2.15 GB | 5dc48f61e4ec |
vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | 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 |
2.15 GB | fa3e70633240 |
vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | 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 |
54.2 kB | 9885f1ccb02a |
vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | 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 |
20.0 MB | 06b9509352d2 |
vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | 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 |
2.12 GB | f6806ca18303 |
vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | 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 |
50.6 kB | 2cbc94582e51 |
vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 6bit | 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 |
17.5 kB | a5a21d176b96 |
vs bf16: PSNR 28.1 dB mean, LPIPS 0.038 mean / 0.044 worst |
| 4bit | 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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 0.24.0 from the original weights at the revision below. Run it with mflux:
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) 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
MOSS-Image-SFT is a supervised fine-tuned text-to-image model in the MOSS-Image family from OpenMOSS, derived from 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.
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:
pip install "diffusers>=0.38" "transformers>=5.3" "accelerate>=1.10" "safetensors>=0.6" "Pillow>=10"
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. 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 and example workflow.
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 for resolution, sampling, prompt, and LoRA training recommendations.
Prompt enhancer skill
The MOSS-Image Prompt Enhancer 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 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.
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.
Showcase
Citation
@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.
We thank the Diffusers, Qwen, and FLUX teams.
Quantized
Model tree for moonbox-ai/MOSS-Image-SFT-MLX
Base model
OpenMOSS-Team/MOSS-Image-Base




