1. moss-image.com
  2. Layout JSON guide

MOSS-Image layout JSON, explained

How MOSS-Image’s bounding-box prompts work, how to convert ordinary coordinates, and three real outputs that show where the boxes are followed — and where they aren’t.

A MOSS-Image layout is a JSON prompt that gives each object and each line of text its own bounding box. You describe the whole scene once, list the elements with their boxes, and the model arranges the image accordingly. OpenMOSS still labels layout control as experimental, but in its 7Bench test, given the same target boxes, MOSS-Image placed objects far more accurately than every other model tested.

The fastest way to write one is our layout editor: drag boxes, type the words, and it exports valid JSON.

The schema

{
  "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"
}
FieldMeaning
summary.captionThe whole scene and its style, in plain language
summary.metaA hint about the medium, such as ["poster"]
items[].labeltext or object in the official examples; ComfyUI’s box node also writes character for people and characters
items[].captionHow that element looks — font, color, material
items[].textThe exact words to render (text items only)
items[].bbox[y_min, x_min, y_max, x_max] in centered pixels
bbox_coord_spaceAlways abs_centralized
bbox_formatAlways yxyx

How the coordinates work

The origin is the center of the canvas, x grows to the right and y grows down, and the vertical coordinate comes first. On a 1024 × 1024 canvas both axes run from −512 to +512.

To convert an ordinary box (left L, top T, width W, height H) on a canvas CW × CH:

bbox = [T − CH/2,  L − CW/2,  T + H − CH/2,  L + W − CW/2]

Example: a title at left 96, top 96, width 832, height 160 on a 1024 × 1024 canvas becomes [-416, -416, -256, 416].

OpenMOSS chose absolute pixels on purpose, saying they suit different resolutions and aspect ratios better than relative coordinates. The catch is that the layout and the output size must match.

A tested example: 字有位置

We submitted this layout to MOSS-Image-Base in the official Space on 17 October 2026 (1024 × 1024, 50 steps, seed 42, CFG 3, shift 5). Download the JSON · generation record.

{
  "summary": {
    "meta": ["poster"],
    "canvas": "single",
    "caption": "A clean blue and white design exhibition poster with a bold Chinese title and a blue abstract sculpture on a white background."
  },
  "items": [
    {
      "label": "text",
      "caption": "Large dark-blue Chinese title at the top.",
      "text": "字有位置",
      "bbox": [-416, -416, -256, 416]
    },
    {
      "label": "object",
      "caption": "An abstract cobalt blue geometric sculpture in the center.",
      "bbox": [-160, -320, 352, 320]
    }
  ],
  "bbox_coord_space": "abs_centralized",
  "bbox_format": "yxyx"
}

Unretouched MOSS-Image-Base output: 字有位置 above a cobalt blue geometric sculpture.

All four Chinese characters rendered correctly and sit in the title box. The model also added an English line, “Design Exhibition”, that we never asked for — a reminder to check outputs before you publish.

Two more outputs: where boxes bend

慢一点 / TAKE A BREAK

Unretouched MOSS-Image-Base café poster: 慢一点, a coffee cup and TAKE A BREAK.

Both lines are readable, but the Chinese title grew taller than its box and nearly touches the cup. JSON · record

周末开场 / WEEKEND SESSIONS

Unretouched MOSS-Image-Base event poster: 周末开场, WEEKEND SESSIONS and a turntable on pink.

Both headlines are correct; the model restyled the type and treated the boxes as guidance rather than hard edges. JSON · record

These are single observed runs, not a benchmark.

Where to use a layout

  • This site: in the layout editor, press Send layout to generator. Square, 3:4 and 4:3 canvases are supported; the boxes are rescaled to the generator’s canvas and prompt enhancement is switched off automatically.
  • ComfyUI: use the built-in Layout-Guided Text to Image template and draw boxes in the node, or paste JSON into the positive prompt with the enhancer off. See the ComfyUI guide.
  • Python / Gradio: pass json.dumps(layout, ensure_ascii=False) as the prompt and set matching height and width. See download & install.
  • API: send the serialized JSON in prompt with a matching size. See the API guide.

Tips for better layouts

  • Give text boxes generous room; text often renders taller than the box.
  • Don’t overlap text boxes. Overlapping objects are fine.
  • Keep each text item short and put long copy on separate lines or items.
  • Put style in caption (“bold condensed red sans-serif”) and only the words in text.
  • Use summary.caption for the overall look so items don’t contradict each other.
  • If the model ignores your boxes, check that prompt enhancement is off and the size matches.
  • Generate two or three seeds — layouts vary between runs.

Questions

What does bbox_format "yxyx" mean?

Each box is written as [y_min, x_min, y_max, x_max] — the vertical coordinate comes first. Combined with bbox_coord_space "abs_centralized", the values are pixels measured from the center of the canvas.

How do I convert normal top-left coordinates?

Subtract half the canvas width from x values and half the canvas height from y values. For a box at left L, top T, width W and height H on a canvas of size CW × CH, the bbox is [T − CH/2, L − CW/2, T + H − CH/2, L + W − CW/2].

Can I mix a layout with a normal prompt?

Yes. OpenMOSS notes the model supports combining natural language and structured input; summary.caption is itself a natural-language description of the whole scene.

Does the canvas size matter?

Yes. The coordinates are absolute pixels, so generate at exactly the width and height the layout was written for. If you change the size, rescale the boxes.

Sources