Repository navigation
MOSS layout v2: official pixel draft, request kind, layout before prompts - #273
Merged
Merged
Conversation
…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.
cargo audit fails on RUSTSEC-2026-0382 and RUSTSEC-2026-0383, and the production deploy requires a green CI run on the merge commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The opt-in MOSS-Image layout (
"prompt_layout": truein 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.moss_layoutholdscanvas_widthandcanvas_height(the 1 MP canvas draw-api renders for each aspect ratio, listed in the prompt;moss_canvas()mirrorsarea_dimensions(ratio, 1024, 16)),summary, anditemswith[x_min, y_min, x_max, y_max]pixel boxes. No word budgets. Items are two schema shapes, so only a text item carriestext: withtextallowed on any item the model folded captions into panel objects, and draw-api dropped them.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.moss_kindandmoss_layoutsort beforeoutputsin the alphabetical grammar order, so the layout is drafted first, as the enhancer does. Afteroutputs, the MOSS prompt (outputs[2]) of the VIP call ran tomax_tokens(runs of\n; with a no-blank-line pattern, endless prose).slot_moss_negativestays after the prompts.textare removed; MOSS-Image drew them. Guillemets stay.Evidence
outputs5 of 25 calls ran away; fields beforeoutputs0 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_kindwas 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).prompt_layoutstays 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.moss_layouts_use_the_pixel_canvas_draw_api_draws(canvas table, prompt text, schema), item shapes,moss_kinddecoding (only layout kinds keep a layout), key ordermoss_kind<moss_layout<outputs<slot_moss_negative, quote stripping, andexamples_write_their_keys_in_the_order_the_grammar_doesfor the moved example fields.Server side: iamwavecut/aifarm-draw#38 (merge and deploy it first).