MOSS-Image-Base and MOSS-Image-SFT
MOSS-Image-Base is a base text-to-image model, and MOSS-Image-SFT is fine-tuned from it on curated data.
What it is · Main features · Getting started
What it is
MOSS-Image-Base is a base text-to-image model. MOSS-Image-SFT is fine-tuned from MOSS-Image-Base on curated data. The standalone pipeline code is provided under the Apache License 2.0.
Core facts
Read by a script from the official API, not rewritten by a model.
- Repository
- https://github.com/OpenMOSS/MOSS-Image
- License
- Apache-2.0
- Languages
- Python
- Maintainer
- OpenMOSS
- Homepage
- http://openmoss.ai/MOSS-Image/
- Verified
Main features
Layout control is listed as controlling the placement of text and visual elements.
The README lists support for text prompts of up to 4K tokens.
MOSS-Image uses JSON layout inputs to control text placement and object arrangement.
In one README example, SFT produces clearer text grouping and a more organized whiteboard layout.
MOSS-Image is supported natively in ComfyUI.
In ComfyUI, the steps are to update to ComfyUI master/nightly with MOSS-Image support, install its dependencies, and then use the built-in loaders with ComfyUI-format weights.
No MOSS-Image plugin is required for this ComfyUI workflow.
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 Prompt Enhancer's bundled script converts pixel-coordinate drafts into compact JSON with integer centered coordinates.
This bundled script does not call an image-generation service.
The project's English user guide and Chinese user guide are the starting point for recommended inference settings, prompt examples, layout input formats, and LoRA training guidance.
mossimage.cpp, by mossimage-cpp, is a native C++/CUDA inference engine for MOSS-Image-Base and MOSS-Image-SFT, with no PyTorch or Python at run time.mossimage.cppplans memory against the GPU it finds and streams the model when it does not fit.For speed, memory measurements and supported GPUs, see the
mossimage.cpprepository; the engine runs with no PyTorch or Python at run time.
Getting started
The sampling settings list Steps as 50.
In Gradio, Memory mode is selected in the Advanced settings.
GPU resident mode keeps the entire model on GPU.
Component mode moves model components between CPU and GPU as needed.
The README labels Sequential mode as fallback and describes it as lower memory use with slower inference.
Low memory mode keeps DiT weights in CPU RAM and loads text encoder and VAE weights from disk as needed.
If GPU memory is insufficient, select Sequential or reduce image size.
The
autoprofile selectsminimalbelow 12 GiB of GPU budget.Compile DiT is disabled by default and unavailable in Sequential and Low memory modes.
The README reports measured peak usage for one 1024×1024 image with 50 steps.
In that measurement, PyTorch GPU memory allocated / reserved is 3.65 / 3.85 GiB.
In the layout example, the
summary.captionfield describes the overall scene and style.The
itemsfield describes individual elements:label,caption, andbbox, withtextfor the words to render.The
bbox_formatfield set to yxyx specifies the order [y_min, x_min, y_max, x_max].The
bbox_coord_spacefield set to abs_centralized uses pixel coordinates relative to the canvas center.On a 1024×1024 canvas, each axis runs from −512 to +512.
Along these axes, x increases to the right and y increases downward.
The coordinates should stay consistent with the requested output dimensions.
In Gradio, the JSON is pasted into the prompt field and the matching width and height are set.
git clone https://github.com/OpenMOSS/MOSS-Image.git
cd MOSS-Image
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtimport 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")pip install -e '.[ui]'
python gradio_app.py --model OpenMOSS-Team/MOSS-Image-Basepython gradio_app.py --profile minimal --model OpenMOSS-Team/MOSS-Image-Base{
"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"
}Sources
This page is written from the official sources below. Open them to check the original text.
- GitHub READMEhttps://github.com/OpenMOSS/MOSS-ImageFetched
Verified ·
This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.
