Layout guide

Layout Control in MossImage: Position Text Precisely with JSON

Most image models treat text as texture. MOSS-Image accepts a JSON layout that gives every text block a bounding box. This guide explains the schema, the coordinate system and three layouts you can copy.

Updated 2026-10-20Open weights · Apache-2.0Hosted: MOSS-Image SFT

How it reaches the model

The layout is serialized to a JSON string and sent as the prompt. MossImage disables prompt expansion for layout requests so the model does not rewrite your boxes. Each bbox must fit the output canvas.

01 / Schema

The JSON layout format

The documented public schema has a summary object and a flat list of items.

FieldMeaning
summary.captionOverall scene, style, canvas and background.
summary.metaOptional medium or genre tags, such as poster or menu.
summary.canvassingle, multi_panel or collage.
items[].labeltext, object, character or panel.
items[].captionWhat the item is, how it is styled and where it sits.
items[].textExact visible text. Required for a text item.
items[].bbox[y_min, x_min, y_max, x_max] in center-origin pixels.
bbox_coord_spaceabs_centralized for the documented format.
bbox_formatyxyx for the documented format.

02 / Coordinates

How the coordinate system works

The canvas center is (0, 0). x increases to the right, y increases downward.

On a 1024×1024 canvas, x and y both run from -512 to 512. A headline across the top half might use [-450, -380, -340, 380]: y from -450 to -340 (above center) and x from -380 to 380 (nearly full width).

Keep every box inside the canvas and make min strictly less than max. The order is y first, then x; a common mistake is to paste x-first boxes from a design tool.

03 / Official example

The travel poster from the MOSS-Image README

This is the documented example, reproduced verbatim.

jsonmono
{
  "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"
}

04 / Templates

Three layouts you can copy

These templates assume a 1024×1024 Final canvas. Rescale the boxes if you use a different tier or ratio.

Cafe menu

jsonmono
{
  "summary": {
    "meta": ["menu"],
    "canvas": "single",
    "caption": "A cream paper cafe menu with a dark green header, two columns of dishes and a small footer note."
  },
  "items": [
    {
      "label": "text",
      "caption": "Large serif cafe name centered at the top.",
      "text": "MORNING BREW",
      "bbox": [-450, -380, -340, 380]
    },
    {
      "label": "text",
      "caption": "Left column heading.",
      "text": "COFFEE",
      "bbox": [-300, -430, -250, -40]
    },
    {
      "label": "text",
      "caption": "Left column items and prices.",
      "text": "Espresso 3.50\nFlat white 4.20",
      "bbox": [-240, -430, -100, -20]
    },
    {
      "label": "text",
      "caption": "Right column heading.",
      "text": "PASTRIES",
      "bbox": [-300, 40, -250, 430]
    },
    {
      "label": "text",
      "caption": "Right column items and prices.",
      "text": "Croissant 3.80\nBanana bread 4.00",
      "bbox": [-240, 40, -100, 430]
    },
    {
      "label": "text",
      "caption": "Small footer note centered at the bottom.",
      "text": "Oat milk +0.50",
      "bbox": [300, -160, 360, 160]
    }
  ],
  "bbox_coord_space": "abs_centralized",
  "bbox_format": "yxyx"
}

Product ad

jsonmono
{
  "summary": {
    "meta": ["product ad"],
    "canvas": "single",
    "caption": "A clean product advertisement for a ceramic coffee mug on a warm beige background with a bold headline and a price badge."
  },
  "items": [
    {
      "label": "text",
      "caption": "Bold uppercase headline at the top left.",
      "text": "SLOW MORNINGS",
      "bbox": [-440, -460, -330, 120]
    },
    {
      "label": "text",
      "caption": "Short supporting line under the headline.",
      "text": "Ceramic mug · 350 ml",
      "bbox": [-300, -460, -240, 120]
    },
    {
      "label": "object",
      "caption": "A matte cream ceramic mug centered in the lower half with a soft studio shadow.",
      "bbox": [-160, -260, 360, 260]
    },
    {
      "label": "text",
      "caption": "Circular price badge in the bottom right corner.",
      "text": "$24",
      "bbox": [260, 300, 380, 460]
    }
  ],
  "bbox_coord_space": "abs_centralized",
  "bbox_format": "yxyx"
}

Minimal poster

jsonmono
{
  "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"
}

05 / Diagnosis

Why generic models garble text

A diffusion model trained only on image-caption pairs has no reason to treat a sentence as a sequence of glyphs. It learns the visual texture of writing, so a long line collapses into plausible-looking strokes. Short brand names sometimes survive; prices, dates and multi-line paragraphs usually do not.

MOSS-Image was trained for text-heavy images: long English and Chinese strings, dense layouts, and explicit boxes. The JSON layout removes the placement guesswork and keeps the exact words in a dedicated field.

06 / Scope

Layout control is not ControlNet

ControlNet, LayoutDiffusion and similar systems are research methods for conditioning a diffusion model with spatial maps. This page is about a prompt format the model already understands. If you are looking for a paper reproduction, use the original papers; if you are trying to put a headline in the right place, use the JSON layout.

07 / FAQ

Layout FAQ

What is layout control in MossImage?

You send a JSON object as the prompt. Each item describes a text block or object and gives it a bounding box. MOSS-Image renders the item inside that box instead of guessing the placement from a paragraph of prose.

What do abs_centralized and yxyx mean?

abs_centralized means the origin is the canvas center: x increases right, y increases down, and each axis runs from minus half the canvas to plus half. yxyx means the four numbers are [y_min, x_min, y_max, x_max].

Do the bboxes have to match the output size?

Yes. For a 1024×1024 canvas each axis runs from -512 to 512. If you switch to HD (1408×1408 on 1:1) or Max (2000×2000 on 1:1), recompute the boxes for that canvas. MossImage validates this before sending the request.

Can I combine a layout with a normal prompt?

The documented model input is one prompt string, so a layout replaces the prose prompt. Describe the overall scene in summary.caption and put individual elements in items. If you do not need exact placement, use a normal prompt instead.

Why is my text still wrong?

Keep the exact visible text in the item.text field, keep each text block short enough for its box, and avoid describing a different font in the caption. Text that does not fit the box may be truncated or reflowed.

Is this the same as ControlNet?

No. ControlNet and LayoutDiffusion are research methods for conditioning diffusion models with spatial maps. MOSS-Image layout control is a JSON prompt format exposed by the model itself; this page is for people making images, not for reproducing papers.

Next

Keep going