MOSS-Image: OpenMOSS Text-to-Image with JSON Layout Control
MOSS-Image is an open 5B text-to-image family from OpenMOSS that accepts natural-language prompts, tags or a structured JSON layout. This guide reproduces the official layout schema, coordinate conventions, recommended sampling settings and installation steps, and explains the Base versus SFT split. It also states the Apache-2.0 license scope and the honest limits: text-to-image only, experimental boxes and long text that still needs proofreading.
View 2 referencesAllow the functional cookie to save your likes. Privacy details
What is MOSS-Image?
MOSS-Image is a text-to-image model family from OpenMOSS built around a compact 5B backbone and native layout control. It accepts natural-language descriptions and structured JSON prompts that specify objects, rendered text and bounding boxes. The official project page lists two checkpoints, Base and SFT, with shared architecture and sampling interfaces.
The family is designed for information-dense images: posters, signs, labels, whiteboards and infographics where text must be readable and elements must land where specified. Weights are licensed under Apache-2.0, and Python and Gradio interfaces use a common Diffusers pipeline.
How do you write a JSON layout prompt?
A layout prompt has a summary block for the overall scene and an items array for individual text and object elements. Each item carries a label, a caption, optional text to render and a bounding box. Coordinates follow [y_min, x_min, y_max, x_max] in pixels relative to the canvas centre.
{
"summary": {
"meta": ["poster"],
"canvas": "single",
"caption": "A minimalist travel poster with a cream background 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]
}
],
"bbox_coord_space": "abs_centralized",
"bbox_format": "yxyx"
}
Paste the JSON into Gradio's prompt field at 1024×1024, or load it in Python and pass the serialized string as the prompt. For more on choosing a checkpoint, see the SFT versus Base guide.
What sampling settings does OpenMOSS recommend?
OpenMOSS recommends flow-matching Euler, 50 steps, CFG 3, shift 5 and negative-branch skipping at layer 22. Those defaults come from the project's quick-start section and apply to both checkpoints. Resolution should be a multiple of 16 pixels on each side.
| Setting | Recommended value |
|---|---|
| Sampler | Flow-matching Euler |
| Steps | 50 |
| CFG | 3.0 (raise for short prompts) |
| Shift | 5 |
| Layer skipping | Negative branch at layer 22 |
| Resolution | 1M–2M pixels typical |
The Python API uses an empty negative prompt. A 1456×1456 output with uncond_skip_layers=[22] is shown in the official example.
How do you install and run MOSS-Image?
Installation is a standard Python 3.10+ and NVIDIA GPU setup with a CUDA-compatible PyTorch build. The official path clones the repository, creates a virtual environment and installs requirements, then loads the model through a Diffusers pipeline with remote code enabled.
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 refrigerator with a handwritten Chinese shopping note on the door.",
height=1456, width=1456,
num_inference_steps=50, guidance_scale=3.0,
uncond_skip_layers=[22],
).images[0]
image.save("note.png")
For low-VRAM machines, Gradio offers GPU resident, Component and Sequential memory modes. Sequential mode disables DiT compilation.
Can MOSS-Image edit images or train LoRAs?
The published models are text-to-image only and take no image input. Editing requires a community LoRA, and LoRA training is supported on the Base checkpoint. OpenMOSS describes Base as the starting point for fine-tuning custom tasks and domains. The prompt enhancer compiles drafts into JSON but does not give the generator image-input ability.
The 5B backbone is small enough for consumer GPUs with quantized weights, which is why LoRA support grew quickly. One documented detail: LoRAs trained on Base also load on SFT. The system-level prompt enhancer is a separate prompt tool and does not add image input to the generator. The weight slider guide shows a concrete example of that ecosystem.
What license covers MOSS-Image?
MOSS-Image weights are released under Apache-2.0. The pipeline code and third-party components retain their own licenses, so check bundled dependencies separately before commercial use. Apache-2.0 permits commercial use, derivatives and redistribution with the license notice preserved. Check each dependency before shipping a product.
OpenMOSS also published two datasets in November 2026, LongLongTextBench and RealLayoutArena, on Hugging Face. Those are evaluation resources, not part of the weights license. The technical report is linked from the project page. Check each bundled dependency before shipping a commercial product.
What can't MOSS-Image do?
MOSS-Image cannot accept reference images in the released checkpoints, enforce bounding boxes as hard constraints, or guarantee perfect long text. The project page calls layout experimental; boxes are strong guidance rather than walls. Long text rendering is a headline strength but still needs proofreading.
The system-level prompt enhancer is a separate component built for GPT-6-family agents with file and Python tools. It compiles drafts into JSON but does not call an image service. Do not conflate the enhancer with the generator itself.
Frequently asked questions about MOSS-Image
These questions cover what a new user needs before the first generation: which of the two checkpoints to install, how long a prompt can be, whether Chinese text renders correctly, and which interface is easiest to start with. The answers follow the official project page and quick-start code.
What are the two checkpoints?
MOSS-Image-Base is the base text-to-image model. MOSS-Image-SFT is fine-tuned from Base on curated data and gives cleaner text grouping in the official comparison.
How long a prompt can I use?
Up to 4K tokens, which is enough for a detailed design brief with subject, lighting, style and exact text.
Does it render Chinese text?
Yes. The official example includes a handwritten Chinese shopping note with line breaks preserved.
Which interface is easiest?
Gradio for interactive work, the Diffusers pipeline for scripts. ComfyUI support is available through a manager plugin.
Should you use MOSS-Image?
MOSS-Image is a practical open model for images that must carry words: 5B parameters, 4K-token prompts, Apache-2.0 weights and a genuinely usable JSON layout interface. Its constraints are clear. It is text-to-image only, layout boxes are guidance rather than guarantees, and long text still needs a human check.