MOSS-Image README

README проекта с github.com/OpenMOSS/MOSS-Image. Одним файлом markdown: README.md.

MOSS-Image MOSS-Image

Hugging Face · MOSS-Image-Base   Hugging Face · MOSS-Image-SFT   ComfyUI Models   ModelScope · MOSS-Image-Base   ModelScope · MOSS-Image-SFT   Hugging Face Spaces · Demo   MOSI API Platform   Homepage   Technical Report   arXiv: 2610.23374   Follow OpenMOSS on X   MOSS-Image QQ 交流群:755535143   MOSS-Builders Feishu Community   MOSS-Image Discord Community

English   |   简体中文

News

Community projects

User guide

Start with the English user guide or 中文用户指南 for recommended inference settings, prompt examples, layout input formats, and LoRA training guidance.

ComfyUI

MOSS-Image is supported natively in ComfyUI. Update to ComfyUI master/nightly with MOSS-Image support and install its dependencies, then use the built-in loaders with ComfyUI-format weights. No MOSS-Image plugin is required for this workflow.

The repository plugin remains available for loading a local Hugging Face / Diffusers directory and for existing plugin workflows.

Installation and usage · HF loader plugin 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.

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.

MOSS-Image-Base and MOSS-Image-SFT

Contents

🤗 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

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 MOSS-Image-SFT

🚀 Quick start

🛠️ Installation

git clone https://github.com/OpenMOSS/MOSS-Image.git
cd MOSS-Image
python -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt

Apple Silicon / MPS

Apple silicon Mac setup and limitations · M1 Max / 32GB

🐍 Python

import torch
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained(
    "OpenMOSS-Team/MOSS-Image-Base",
    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")
image = pipe(
    "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:“\n记得买牛奶和鸡蛋!\n牛奶两盒,鸡蛋一打。\n顺便带一袋面包。”",
    height=1456,
    width=1456,
    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")

🎨 Gradio

pip install -e '.[ui]'
python gradio_app.py --model OpenMOSS-Team/MOSS-Image-Base

🎛️ 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

See the user guide for sampling and prompt recommendations.

⚡ Memory and performance

Select Memory mode in Gradio's Advanced settings:

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
Low memory Keep DiT weights in CPU RAM; load text encoder/VAE weights from disk as needed

If GPU memory is insufficient, select Sequential or reduce image size. For lower GPU and system memory use, select the minimal profile (Low memory mode):

python gradio_app.py --profile minimal --model OpenMOSS-Team/MOSS-Image-Base

The auto profile selects minimal below 12 GiB of GPU budget. Keep the model files on an SSD: DiT stays in CPU RAM, while the text encoder and VAE load weights as needed.

Measured peak usage for one 1024×1024 image with 50 steps:

Resource Peak usage
PyTorch GPU memory allocated / reserved 3.65 / 3.85 GiB
Task system RAM, including file cache 14.00 GiB

Compile DiT is disabled by default and unavailable in Sequential and Low memory modes.

📐 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.

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.

Layout bounding boxes

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:

{
  "summary": {
    "meta": ["poster"],
    "canvas": "single",
    "caption": "A minimalist travel poster with a cream background, a blue mountain illustration, and the title EXPLORE at the top."
  },
  "items": [
    {
      "label": "text",
      "caption": "Large dark-blue uppercase title centered at the top.",
      "text": "EXPLORE",
      "bbox": [-416, -384, -288, 384]
    },
    {
      "label": "object",
      "caption": "A flat blue mountain illustration in the lower center.",
      "bbox": [-192, -288, 384, 288]
    }
  ],
  "bbox_coord_space": "abs_centralized",
  "bbox_format": "yxyx"
}

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.

🖼️ Showcases

Examples overview

Examples overview 2

📝 Citation

If you use MOSS-Image in your research, please cite our technical report:

@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 standalone pipeline code is provided under the Apache License 2.0.

We thank the Diffusers, Qwen and FLUX teams.

⭐ Star History

Star History Chart

MOSS-Image (OpenMOSS/MOSS-Image)

Ищем в базе…

Что это такое?MOSS-Image — это диффузионная трансформер-модель (DiT) для генерации изображений по тексту с 5 миллиардами параметров. Она хорошо отрисовывает текст, позволяет задавать расположение текста и объектов с помощью JSON-разметки и эффективно дообучается (в том числе через LoRA) под собственные задачи.
Это готовое приложение или модель, которую нужно подключать самому?Модель поставляется в виде базовой версии и версии SFT с кодом инференса на Python и демо на Gradio, а также с нативным плагином для ComfyUI. Изображения можно создавать из скрипта, через веб-интерфейс или внутри ComfyUI, без собственного пайплайна.
Как это запустить?Установите окружение Python по разделу Installation в README, скачайте веса MOSS-Image-Base или MOSS-Image-SFT с ModelScope, затем запустите инференс через Python API или откройте приложение на Gradio. Для ComfyUI достаточно установить плагин через ComfyUI Manager.
Есть ли подвохи при запуске на GPU с ограниченной памятью?При нехватке видеопамяти придётся перейти на более медленные режимы памяти Component или Sequential. Компиляция DiT по умолчанию выключена, а в режиме Sequential она вообще недоступна.
В чём разница между MOSS-Image-Base и MOSS-Image-SFT?Base — это предобученная основа для генерации изображений по тексту, а SFT дообучена на отобранных данных для более чёткой группировки текста и более упорядоченной компоновки. Это видно на примере сравнения с доской (whiteboard) в README.
Как на самом деле работает управление раскладкой через JSON?Вы пишете файл layout.json с общим описанием (summary caption) и списком элементов. У каждого элемента есть метка, подпись, текст для отрисовки и рамка (bounding box) в пиксельных координатах относительно центра холста. Затем вставляете этот JSON в поле промпта в Gradio, указав такие же ширину и высоту, и так задаёте расположение текста и объектов.
Для чего нужен навык Prompt Enhancer?Это навык для кодовых агентов семейства GPT, который превращает грубую идею изображения в подробную подпись или компактный Layout JSON с целочисленными координатами относительно центра. Результат вы вставляете в промпт MOSS-Image. Навык только оформляет промпты и никогда сам не обращается к сервису генерации изображений.
Насколько длинными могут быть текстовые промпты?MOSS-Image принимает промпты длиной до 4K токенов, так что можно писать подробные развёрнутые описания сцен, а не только короткие подписи.
Какие есть похожие проекты?LTX-Video, Wan2.1, SMD, stable-diffusion-webui-colab, Z-Image, SolarRenderer, SolarWM, SenseNova-U1
Автор
OpenMOSS
Размер
85.5 MB
Звёзды
2.9K
Обновлён
КоммитNov 08
Возраст
1 мес
Коммиты · 90 дней