How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("vanch007/MOSS-Image-SFT-mlx-bf16", dtype=torch.bfloat16, device_map="cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]

MOSS-Image-SFT-mlx-bf16

English | 中文说明


中文说明

本仓库提供专为 Apple Silicon (Mac) 优化的 mflux MLX BF16 原生格式权重,基于复旦大学 OpenMOSS-Team/MOSS-Image-SFT 图像生成大模型进行原生移植与转换。

完整支持通过 mflux 在 Apple Silicon Mac (M系列芯片) 上直接离线运行纯本地的高精度中文排版生成、复杂 Layout 空间布局生图与商业摄影大片。

核心亮点

  1. **42 层 DiT 单流 Transformer (原生 BF16)**:42 个 Transformer Block,隐藏层维度 3072,全量 MLX 原生 SDPA 注意力加速与 _situ 门控激活函数。
  2. Qwen 3.5 多模态文本编码:无缝支持长文本与复杂结构化 Layout-to-Image JSON 提示词,实现精准的中文文字排版与书法渲染。
  3. FLUX.2 Small VAE 高清解码:原生对齐批归一化反变换,对比度饱满、高光通透、暗部深邃。
  4. 原生支持 StepCache 缓存加速:支持残差特征跳步复用,大幅减少深层计算开销。

快速开始 (CLI)

1. 命令行直接生图

mflux-generate-moss-image \
  --model vanch007/MOSS-Image-SFT-mlx-bf16 \
  --prompt 'A wide view of a modern kitchen refrigerator. A small yellow sticky note on the refrigerator door is clearly handwritten in clean Chinese calligraphy: "记得买牛奶和鸡蛋!顺便带一袋面包。" Warm kitchen light, high resolution, sharp focus.' \
  --width 1024 \
  --height 1024 \
  --steps 25 \
  --guidance 3.0 \
  --output refrigerator.png

2. Python API 调用

from mflux.models.moss_image.variants.txt2img.moss_image import MOSSImage

model = MOSSImage(model_path="vanch007/MOSS-Image-SFT-mlx-bf16")

image = model.generate_image(
    prompt='A cute fluffy ginger cat sitting on a polished wooden table in soft morning window light, realistic photography, sharp focus.',
    width=1024,
    height=1024,
    num_inference_steps=25,
    guidance_scale=3.0,
    seed=42,
)
image.save("ginger_cat.png")

English

This repository provides the native MLX BF16 format weights of OpenMOSS-Team/MOSS-Image-SFT for Apple Silicon via mflux.

Highlights

  • 42-layer single-stream DiT transformer in native MLX format.
  • Qwen 3.5 text encoder supporting complex layout JSON and bilingual text rendering.
  • FLUX.2 Small VAE for clean, high-dynamic-range image reconstruction.

Acknowledgments

Downloads last month
42
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for vanch007/MOSS-Image-SFT-mlx-bf16

Finetuned
(11)
this model