๐ MOSS Layout (Drawer)
MOSS-Image layout prompts without hand-writing the JSON
- prompt
- width
- height
Layout-prompt models are a strange deal: you get real spatial control - "the cat goes there, the lamp goes there" - and the price is a JSON blob of bounding boxes with the origin at the canvas centre. Nobody wants to type that. DrawerMossLayout exists so you don't have to: drag boxes in ComfyUI-Drawer's Deck panel and it writes the JSON back into the node's text field.
What the node actually is
On the canvas it's almost disappointingly plain: a multiline text widget, two integers width and height, and a Python class that hands all three straight back out as prompt, width and height. It returns its own inputs, unchanged.
The trick is that it's one of nine nodes in the pack with dedicated Deck UI. Open the drawer - or the standalone page at http://<your-host>:8188/drawer/app - mark the node for Deck, and the text box becomes a box editor: your canvas at the right aspect ratio, draggable boxes with corner handles, a per-box detail panel, and a raw JSON view underneath.
Why care? MOSS-Image reads a layout prompt, not a tag soup - structured prompting is where the 2026 models went, and this is the strict version, where one stray bracket means no image.
What's inside the text field
The prompt is a JSON object with a summary - a caption for the whole image (the author's hint: "scene, style, lighting, palette, mood") plus optional meta, palette and a canvas of single / multi_panel / collage - and an items array of boxes. Each box has a label of object, character or text, a caption ("how it looks: clothing, pose, colors, materials"), optional tags and palette, a text field used only on text boxes for the exact characters to render, and a bbox.
The bbox is what hurts by hand: [y0, x0, y1, x1] in pixels on the width ร height canvas, with bbox_coord_space: "abs_centralized" and bbox_format: "yxyx" - origin at the centre, so the top-left corner is negative. In Deck you never see that: positions show as a percentage from the top-left, and the pixels sit in each field's tooltip.
Two behaviours worth knowing. With no items and nothing in the summary but a caption, the node serialises to just the caption string - no JSON at all - so an unused node is a harmless plain prompt node. If you paste a draft in the other convention (abs / xyxy, top-left pixels - what the official prompt enhancer and most LLMs hand you), Deck offers Convert and edit, which clamps and re-bases the boxes. Any other coordinate space it refuses outright.
Inputs, outputs, and where the wires go
You set three things: text (the layout, written by the editor), width and height (defaults 1024ร1024, step 16, max 16384). Out come prompt, width, height.
prompt goes to whatever consumes MOSS-Image's layout prompt in your graph - the same format ComfyUI's own layout-prompt node uses. width and height go to the latent, and this is the part people skip: the canvas in the editor is the canvas the boxes are placed in, so these numbers have to match the resolution you actually sample at. Wire them from one source - a DrawerSize, a PrimitiveInt, or straight off the latent node - and node and picture stay in sync.
Deck computes a linked size itself when the source is something it understands (reroute, primitive, DrawerSize, ResolutionSelector, DrawerControls); otherwise it uses the last run's size. Until it has one, don't trust the grid.
Installing it
ComfyUI Manager, search ComfyUI-Drawer, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Kuroi961/ComfyUI-Drawer.git
pip install -r ComfyUI-Drawer/requirements.txt
Then restart ComfyUI. The dependency list is a single line (Send2Trash) because the pack leans on Pillow and SQLite, which ComfyUI ships anyway; ffmpeg/ffprobe are optional, for the Gallery gadget's video thumbnails. No models ship with the pack - your MOSS-Image checkpoint and text encoder are separate downloads.
Common issues
The draw-able editor isn't there. On the canvas you get a textarea; the box editor lives in Deck. The likeliest "this node does nothing" report.
Boxes look shifted against the real image. Canvas mismatch - check that width/height match the latent.
"Not valid JSON. Fix it below." The editor won't own text it can't parse and drops you into the raw JSON textarea. Fix it there, or clear the field and start from a caption - wiping it is a legitimate reset.
"โฆboxes can't be edited here (only abs_centralized / yxyx)." You dropped in a draft or another tool's format. If it's the top-left abs/xyxy style, hit Convert and edit. Otherwise it's a text-editor job.
One caveat: ComfyUI-Drawer is, per the author, 100% AI-coded under human direction and review, and it moves fast - skim CHANGELOG.md after an update.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| width | INT | 102416โ16384 | โ |
| height | INT | 102416โ16384 | โ |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | โ |
| width | INT | โ |
| height | INT | โ |