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.

Verified

On this page

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.

License
Apache-2.0
Languages
Python
Maintainer
OpenMOSS
Verified

Main features

  1. Layout control is listed as controlling the placement of text and visual elements.

  2. The README lists support for text prompts of up to 4K tokens.

  3. MOSS-Image uses JSON layout inputs to control text placement and object arrangement.

  4. In one README example, SFT produces clearer text grouping and a more organized whiteboard layout.

  5. MOSS-Image is supported natively in ComfyUI.

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

  7. No MOSS-Image plugin is required for this ComfyUI workflow.

  8. The MOSS-Image Prompt Enhancer turns image ideas into detailed captions or spatial Layout prompts.

  9. It is designed for GPT-6-family agents with local file and Python tools.

  10. The Prompt Enhancer's bundled script converts pixel-coordinate drafts into compact JSON with integer centered coordinates.

  11. This bundled script does not call an image-generation service.

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

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

  14. mossimage.cpp plans memory against the GPU it finds and streams the model when it does not fit.

  15. For speed, memory measurements and supported GPUs, see the mossimage.cpp repository; the engine runs with no PyTorch or Python at run time.

Getting started

  1. The sampling settings list Steps as 50.

  2. In Gradio, Memory mode is selected in the Advanced settings.

  3. GPU resident mode keeps the entire model on GPU.

  4. Component mode moves model components between CPU and GPU as needed.

  5. The README labels Sequential mode as fallback and describes it as lower memory use with slower inference.

  6. Low memory mode keeps DiT weights in CPU RAM and loads text encoder and VAE weights from disk as needed.

  7. If GPU memory is insufficient, select Sequential or reduce image size.

  8. The auto profile selects minimal below 12 GiB of GPU budget.

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

  10. The README reports measured peak usage for one 1024×1024 image with 50 steps.

  11. In that measurement, PyTorch GPU memory allocated / reserved is 3.65 / 3.85 GiB.

  12. In the layout example, the summary.caption field describes the overall scene and style.

  13. The items field describes individual elements: label, caption, and bbox, with text for the words to render.

  14. The bbox_format field set to yxyx specifies the order [y_min, x_min, y_max, x_max].

  15. The bbox_coord_space field set to abs_centralized uses pixel coordinates relative to the canvas center.

  16. On a 1024×1024 canvas, each axis runs from −512 to +512.

  17. Along these axes, x increases to the right and y increases downward.

  18. The coordinates should stay consistent with the requested output dimensions.

  19. In Gradio, the JSON is pasted into the prompt field and the matching width and height are set.

From the README
Shell
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
From the README
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")
From the README
Shell
pip install -e '.[ui]'
python gradio_app.py --model OpenMOSS-Team/MOSS-Image-Base
From the README
Shell
python gradio_app.py --profile minimal --model OpenMOSS-Team/MOSS-Image-Base
From the README
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"
}

Sources

This page is written from the official sources below. Open them to check the original text.

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.