Skip to content

MOSS layout v2: official pixel draft, request kind, layout before prompts - #273

Merged
iamwavecut merged 2 commits into
mainfrom
feat/moss-layout-pixels
Oct 20, 2026
Merged

iamwavecut merged 2 commits into
mainfrom
feat/moss-layout-pixels

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Summary

The opt-in MOSS-Image layout ("prompt_layout": true in the MOSS model config, still off) now follows the official prompt enhancer (skills/moss-image-prompt-enhancer). The prose route and the optimizer prompt without a layout render unchanged.

  • Pixel draft. moss_layout holds canvas_width and canvas_height (the 1 MP canvas draw-api renders for each aspect ratio, listed in the prompt; moss_canvas() mirrors area_dimensions(ratio, 1024, 16)), summary, and items with [x_min, y_min, x_max, y_max] pixel boxes. No word budgets. Items are two schema shapes, so only a text item carries text: with text allowed on any item the model folded captions into panel objects, and draw-api dropped them.
  • Request kind instead of a flag. moss_kind (poster, comic, meme, infographic, arrangement, card, cover, menu, other_design, scene); code keeps a layout only for the first five (MOSS_LAYOUT_KINDS). With the boolean flag and a narrowed rule the model still marked menus, cards and covers as designed.
  • Layout before the prompts. moss_kind and moss_layout sort before outputs in the alphabetical grammar order, so the layout is drafted first, as the enhancer does. After outputs, the MOSS prompt (outputs[2]) of the VIP call ran to max_tokens (runs of \n; with a no-blank-line pattern, endless prose). slot_moss_negative stays after the prompts.
  • Quotes. ASCII or curly quotes that wrap a whole layout text are removed; MOSS-Image drew them. Guillemets stay.

Evidence

  • Production Gemma (as a client), VIP Krea 2 + FLUX.3 + MOSS with layout: fields after outputs 5 of 25 calls ran away; fields before outputs 0 of 48 VIP + 12 MOSS-only calls, median 5.7 s, max 14.1 s, no junk slot. The deployed prompt without a layout: 0 of 12. moss_kind was the same in every repeat for all 24 requests (posters → poster, memes → meme/comic, comics → comic, infographics → infographic, menu → other_design, card → card, cover → cover, photos → scene).
  • MOSS A/B (Vast RTX 4090, production settings, 14 designed requests × prose / layout / layout+prose × 2 seeds, 84 images): letter defects prose 10 (9 of 26 images), layout 6, layout+prose 6. Layout keeps multi-line meme captions right ("в проде", "прошёл" where prose drew "в преде", "прошел"); its failures were boxes crowded into a strip (draw-api now rejects those, iamwavecut/aifarm-draw#38) and quotes around titles (removed here). prompt_layout stays off until the owner decides.

Tests

  • cargo test --locked --workspace, cargo clippy --locked --workspace --all-targets --all-features -- -D warnings, cargo fmt --all -- --check: pass.
  • New or changed: moss_layouts_use_the_pixel_canvas_draw_api_draws (canvas table, prompt text, schema), item shapes, moss_kind decoding (only layout kinds keep a layout), key order moss_kind < moss_layout < outputs < slot_moss_negative, quote stripping, and examples_write_their_keys_in_the_order_the_grammar_does for the moved example fields.

Server side: iamwavecut/aifarm-draw#38 (merge and deploy it first).

…mpts

The opt-in MOSS-Image layout (MOSS model config "prompt_layout": true)
now follows the official prompt enhancer
(skills/moss-image-prompt-enhancer):

- moss_layout holds canvas_width and canvas_height, the 1 MP canvas
  draw-api renders for the chosen aspect ratio (listed in the prompt),
  summary, and items with [x_min, y_min, x_max, y_max] pixel boxes; no
  word budgets. Items are two schema shapes, so only a text item carries
  text: given text on any item, the model folded captions into panels.
- moss_kind names the request (poster, comic, meme, infographic,
  arrangement, card, cover, menu, other_design, scene) instead of a
  boolean, and code keeps a layout only for the first five. With the
  boolean the model also marked menus, cards and covers as designed.
- moss_kind and moss_layout sort before outputs, so the layout is drafted
  before the prompts. After them, the three-slot VIP call ran the MOSS
  prompt to the token limit in 5 of 25 production calls; before them, in
  0 of 60. slot_moss_negative stays after the prompts.
- Quotes that wrap a whole layout text are removed; MOSS-Image drew them.

The prose route and the prompt without a layout are unchanged.
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Warnings
⚠️ Prompt files are cache-sensitive contracts; confirm prompt shape and role markers were preserved intentionally.
Messages
📖 Danger checked 3 changed file(s).

Generated by 🚫 dangerJS against e609805

cargo audit fails on RUSTSEC-2026-0382 and RUSTSEC-2026-0383, and the
production deploy requires a green CI run on the merge commit.
@iamwavecut
iamwavecut merged commit c9888bf into main Oct 20, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the feat/moss-layout-pixels branch October 20, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant