MOSS-Image发布:5B参数DiT模型,支持高质量文字渲染与布局控制
OpenMOSS/MOSS-Image: Official repository for MOSS-Image, a 5B-parameter base DiT model with high-quality text rendering, layout generation,…
开源DiT新选择,文字渲染与布局控制是Agent落地刚需,建议做多模态应用的同学直接上手压测。
Official repository for MOSS-Image, a 5B-parameter base DiT model with high-quality text rendering, layout generation, and efficient fine-tuning.
MOSS-Image 的官方仓库,这是一个拥有 50 亿参数的基础 DiT 模型,具备高质量文本渲染、布局生成和高效微调能力。
GitHub repository created 2026-10-16 · 1039 stars in 4.2 days (about 246 a day) · Python
GitHub 仓库创建于 2026-10-16 · 4.2 天内获得 1039 颗星(平均每天约 246 颗)· Python
English | 简体中文
News
新闻
- **[2026-10-20]** 🛠️ DiffSynth-Studio now supports full fine-tuning and LoRA training for MOSS-Image-Base and MOSS-Image-SFT. See the training documentation and example scripts.
- **[2026-10-19]** 📄 The MOSS-Image Technical Report is now available on arXiv.
- **[2026-10-16]** 🚀 MOSS-Image has day-0 support in SGLang, vLLM-Omni, and ComfyUI.
- **[2026-10-16]** 🎉 We are introducing MOSS-Image-Base and MOSS-Image-SFT! Code and model weights are publicly available.
- **[2026-10-20]** 🛠️ DiffSynth-Studio 现在支持对 MOSS-Image-Base 和 MOSS-Image-SFT 进行全量微调和 LoRA 训练。请参阅训练文档和示例脚本。
- **[2026-10-19]** 📄 MOSS-Image 技术报告现已在 arXiv 上发布。
- **[2026-10-16]** 🚀 SGLang、vLLM-Omni 和 ComfyUI 已原生支持 MOSS-Image。
- **[2026-10-16]** 🎉 我们推出了 MOSS-Image-Base 和 MOSS-Image-SFT!代码和模型权重已公开可用。
Our key highlights:
我们的核心亮点:
- 📐 Layout control: Control the placement of text and visual elements. - ✍️ Strong text rendering: Generate clear, accurate text within images. - 📜 Long-prompt support: Accept text prompts of up to 4K tokens. - 🎨 Versatile visual styles: Create high-quality anime and photorealistic images. - 🛠️ Easy to fine-tune: Adapt the base model to custom tasks and domains. - ⚡ Compact and efficient: Efficient image generation with a 5B backbone. - 🖥️ Heterogeneous GPU training: Trained on alternative GPU platforms.
- 📐 布局控制:控制文本和视觉元素的位置。 - ✍️ 强大的文本渲染:在图像中生成清晰、准确的文本。 - 📜 长提示词支持:接受长达 4K token 的文本提示。 - 🎨 多样的视觉风格:创建高质量的动漫和照片级真实图像。 - 🛠️ 易于微调:将基础模型适配到自定义任务和领域。 - ⚡ 紧凑且高效:使用 50 亿参数骨干网络实现高效的图像生成。 - 🖥️ 异构 GPU 训练:在交替使用的 GPU 平台上进行训练。
User guide
用户指南
Start with the English user guide or 中文用户指南 for recommended inference settings, prompt examples, layout input formats, and LoRA training guidance.
从英文用户指南或中文用户指南开始 获取推荐的推理设置、提示词示例、布局输入格式以及 LoRA 训练指导。
ComfyUI
This repository provides a native MOSS-Image plugin for ComfyUI.
本仓库为 ComfyUI 提供了原生的 MOSS-Image 插件。
Search for MOSS-Image in ComfyUI Manager to install the plugin. We are actively working toward integration into the official ComfyUI repository.
在 ComfyUI Manager 中搜索 MOSS-Image 以安装插件。 我们正在积极努力将其集成到官方 ComfyUI 仓库中。
Installation and usage · Example workflow
安装与使用 · 示例工作流
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.
MOSS-Image Prompt Enhancer 将 图像创意转化为详细的描述或空间布局提示词。它专为配备本地文件和 Python 工具的 GPT-6 系列智能体设计。捆绑的脚本将像素坐标草稿转换为带有整数居中坐标的紧凑 JSON; 它不调用图像生成服务。
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.
将该技能文件夹安装到您的智能体的 skills 目录中,然后使用您的图像创意、期望的描述或布局输出以及画布尺寸调用 `$moss-image-prompt-enhancer`。将编译后的结果粘贴到 MOSS-Image 的正向提示词中;对于布局,请使用相同的生成尺寸。
Contents
目录
- News - User guide - ComfyUI - Prompt enhancer skill - Models - Quick start - Installation - Python - Gradio - Sampling settings - Memory and performance - Layout-to-image generation - Showcase - Citation - License and acknowledgements - Star History
- 新闻 - 用户指南 - ComfyUI - 提示词增强技能 - 模型 - 快速入门 - 安装 - Python - Gradio - 采样设置 - 内存与性能 - 布局到图像生成 - 展示 - 引用 - 许可与致谢 - Star 历史
🤗 Models
🤗 模型
| Model | Description | ||
|---|---|---|---|
| MOSS-Image-Base · ModelScope | Base text-to-image model | ||
| MOSS-Image-SFT · ModelScope | Fine-tuned from MOSS-Image-Base on curated data |
| 模型 | 描述 | ||
|---|---|---|---|
| MOSS-Image-Base · ModelScope | 基础文本到图像模型 | ||
| MOSS-Image-SFT · ModelScope | 在精选数据上从 MOSS-Image-Base 微调而来 |
Base vs. SFT
Base 与 SFT 的区别
In this example, SFT produces clearer text grouping and a more organized whiteboard layout.
在此示例中,SFT 产生了更清晰的文本分组和更有序的白板布局。
| MOSS-Image-Base | MOSS-Image-SFT | ||
|---|---|---|---|
🚀 Quick start
🚀 快速入门
🛠️ Installation
🛠️ 安装
🐍 Python
🎨 Gradio
🎛️ Sampling settings
🎛️ 采样设置
| Setting | Default | ||
|---|---|---|---|
| Sampler | Flow-matching Euler | ||
| Steps | 50 | ||
| CFG | 3 | ||
| Shift | 5 | ||
| Layer skipping | Negative-branch skipping at layer 22 | ||
| Negative prompt (Python API) | Empty |
| 设置 | 默认值 | ||
|---|---|---|---|
| 采样器 | Flow-matching Euler | ||
| 步数 | 50 | ||
| CFG | 3 | ||
| Shift | 5 | ||
| 层跳过 | 在第 22 层进行负分支跳过 | ||
| 负面提示词 (Python API) | 空 |
See the user guide for sampling and prompt recommendations.
请参阅用户指南以获取采样和提示词的推荐。
⚡ Memory and performance
⚡ 内存与性能
Select Memory mode in Gradio's Advanced settings:
在 Gradio 的高级设置中选择内存模式:
| Mode | Behavior | ||
|---|---|---|---|
| GPU resident | Keep the entire model on GPU | ||
| Component | Move model components between CPU and GPU as needed | ||
| Sequential · fallback | Lower memory use with slower inference |
| 模式 | 行为 | ||
|---|---|---|---|
| GPU 常驻 | 将整个模型保留在 GPU 上 | ||
| 组件 | 根据需要移动模型组件至 CPU 或 GPU | ||
| Sequential · fallback | 降低内存使用,但推理速度较慢 |
If GPU memory is insufficient, select Sequential or reduce image size. Compile DiT is disabled by default and unavailable in Sequential mode.
如果 GPU 内存不足,请选择 Sequential 模式或减小图像尺寸。 默认情况下禁用 DiT 编译,且在 Sequential 模式下不可用。
📐 Layout-to-image generation
📐 布局到图像生成
MOSS-Image uses JSON layout inputs to control text placement and object arrangement in complex text-to-image compositions. The image below was generated by MOSS-Image using layout control.
MOSS-Image 使用 JSON 布局输入来控制复杂文本到图像合成中的文本放置和对象排列。 下图是使用布局控制由 MOSS-Image 生成的图像。
Layouts can also support controlled editing and user-friendly layout tools. By editing text, element descriptions, and bounding boxes, users can adjust image content and composition in a structured way.
布局还支持受控编辑和用户友好的布局工具。 通过编辑文本、元素描述和边界框,用户可以以结构化的方式调整图像内容和构图。
Paste the layout JSON into Gradio’s Prompt field to specify the scene, text, objects, and their positions. The following example uses a `summary`/`items` layout for a 1024×1024 canvas. Save it as `layout.json`:
将布局 JSON 粘贴到 Gradio 的 Prompt 字段中,以指定场景、文本、 对象及其位置。以下示例为 1024×1024 画布使用了 `summary`/`items` 布局。将其保存为 `layout.json`:
- `summary.caption` describes the overall scene and style. - `items` describes individual elements: `label`, `caption`, and `bbox`, with `text` for the words to render. - `bbox_format: "yxyx"` specifies `[y_min, x_min, y_max, x_max]`. - `bbox_coord_space: "abs_centralized"` uses pixel coordinates relative to the canvas center. On a 1024×1024 canvas, each axis runs from −512 to +512; x increases to the right and y increases downward. For a canvas of width W and height H, subtract W/2 from ordinary x coordinates and H/2 from y coordinates.
- `summary.caption` 描述整体场景和风格。 - `items` 描述各个元素:`label`、`caption` 和 `bbox`,其中 `text` 用于渲染文字。 - `bbox_format: "yxyx"` 指定 `[y_min, x_min, y_max, x_max]`。 - `bbox_coord_space: "abs_centralized"` 使用相对于画布中心的像素坐标。在 1024×1024 画布上,每个轴的范围从 −512 到 +512; x 向右增加,y 向下增加。对于宽度为 W、高度为 H 的画布,普通 x 坐标需减去 W/2,y 坐标需减去 H/2。
Keep the coordinates consistent with the requested output dimensions. In Gradio, paste the JSON into the prompt field and set the matching width and height. With the Python API, pass `json.dumps(layout, ensure_ascii=False)` as the prompt string.
保持坐标与请求的输出尺寸一致。在 Gradio 中,将 JSON 粘贴到提示词字段,并设置匹配的宽度和高度。使用 Python API 时,将 `json.dumps(layout, ensure_ascii=False)` 作为提示词字符串传入。
🖼️ Showcases
🖼️ 展示案例
📝 Citation
📝 引用
If you use MOSS-Image in your research, please cite our technical report:
如果您在研究中使用了 MOSS-Image,请引用我们的技术报告:
📄 License and acknowledgements
📄 许可证与致谢
The standalone pipeline code is provided under the Apache License 2.0.
独立管道代码遵循 Apache License 2.0 许可协议提供。
We thank the Diffusers, Qwen and FLUX teams.
我们感谢 Diffusers、Qwen 和 FLUX 团队。
⭐ Star History
⭐ Star 历史
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力