Nodes/MOSS BBOX Prompter/MOSS BBOX Canvas
ComfyUI Node

MOSS BBOX Canvas

Draw the layout, hand off one wire

By ukr8b3g-cmyk·Created 10 days ago·Updated 3 days ago· 6
MOSS BBOX Canvas
  • reference_image
  • framing_data
◄width896►
◄height1184►
◄presetCustom►
◄layout_data{"boxes":[]}►
◄camera_data{"iso":"","shutter":"","aperture":"","focal_length":""}►
◄grid_modeThirds►
◄ui_languageAuto►
◄camera_set_data{"sets":[],"selected":""}►
◄canvas_preset_data{"sets":[],"selected":""}►
◄width_override—►
◄height_override—►

This is the canvas to use. MOSSSharedCanvas is the current drawing surface in the MossImage-BBOX-Prompter pack: seven colors, pixel-accurate box editing, alignment tools, presets, an optional reference underlay, and a single output - framing_data - that goes to MOSS BBOX Export and, if you want to see what happened, to MOSS BBOX Preview.

If you came from a tutorial with two nodes and no Export, you're on the old pair. This is the replacement, and the sharpest difference is that odd name collision: both it and the legacy node display as "MOSS BBOX Canvas". Search results mark the old one deprecated; the give-away is the output, framing_data versus the legacy canvas_data.

What it's for

MOSS-Image is conditioned on structured layout captions - summary, typed items, bounding boxes in centralized pixel yxyx - so authoring boxes is not optional decoration, it's how you use the model properly. Every model with a JSON caption schema ends up needing a canvas in front of it. This one's decent: drag to draw, Ctrl/Cmd-click to multi-select, Alt-drag to duplicate, Shift-drag a corner to keep aspect ratio, arrow keys for 1px nudges (Shift for 10), and align/distribute for when you're lining up three objects by eye at 2am.

How it works

The node is a thin shell around the bundled canvas controls. Its widgets hold the drawing as serialized state (layout_data for boxes, camera_data for optics, camera_set_data and canvas_preset_data for your saved presets), and the front-end DOM widget reads and writes those strings as you work. On execution it resolves the real dimensions and emits a single JSON blob tagged krea2_element_framing_v1 containing width, height, camera values and the boxes - each with its color slot and, if you gave that box its own ID card, its individual prompt data.

Dimension resolution has an order to it, and it's the number one source of confusion: a preset other than Custom wins over the width/height widgets, and width_override / height_override beat both when connected. The 11 presets are all multiples of 16 (1024 x 1536, 1536 x 2048, 1344 x 1024, and so on) because MOSS's latent path divides by 16 and the pack won't hand it a size it would silently truncate.

Inputs and outputs

You'll set width and height (default 896×1184), preset, and maybe grid_mode (Thirds by default, or Center Cross, or Off). ui_language only changes hover help and labels - it never touches output. Everything else is bookkeeping the UI maintains.

Three optional inputs: width_override and height_override for driving the canvas size from another node, and reference_image - connect Load Image's IMAGE here to see a photo under the boxes while you draw. Two things about that reference: it's read without queueing, and it's a drawing aid only. It adds no image conditioning, no img2img, nothing to the prompt. Turn it on with the canvas's own Reference toggle and dial Opacity until boxes stay readable. "Match image size" will resize the canvas to the reference (rounded to a multiple of 16) and scale every box proportionally, as one undoable step.

Output: framing_data, and only that. Branch it - one wire to MOSS BBOX Export's framing_data, one to MOSS BBOX Preview's framing_data.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/ukr8b3g-cmyk/MossImage-BBOX-Prompter.git

Or ComfyUI-Manager → Install via Git URL with the repo URL. Restart ComfyUI when your running jobs finish, then Ctrl+F5. The pack declares no pip dependencies and downloads no models; you supply MOSS-Image weights, and rgthree-comfy if you want the bundled example workflows to load cleanly.

Layouts are portable too. The JSON… button exports either placement-only (MOSS_BBOX_Layout.json - dimensions, coordinates, colors) or an editable file that carries per-box prompts, types, framing, angles and text styles. Import defaults to Replace boxes + Keep current Canvas size; choose Use source size if the file came from a different aspect ratio.

Troubleshooting

Boxes look offset in the output. Your latent isn't the canvas size. Check whether a preset or an override is quietly setting dimensions differently from what you wired downstream.

"Match image size" is greyed out. No reference image connected, a corrupt layout, or external width/height connections are in control.

Reference image won't load. Over 16384px per side needs resizing first, and source images aren't embedded in the workflow - the file has to stay on the ComfyUI server.

Cyclic dependency error. You wired a generation IMAGE back into reference_image. Don't; load the saved file with Load Image instead.

Your layout came back empty. A malformed saved layout is preserved as-is with an error tooltip and drawing suspended until Reset Canvas or a valid workflow load - the 1.0.1 behaviour, and it's the reason your boxes never silently vanish.

One expectation to set: nothing here detects objects or scores your placement, and boxes are guidance rather than constraints. The overlay in Preview exists precisely because the model sometimes ignores you.

Categoryconditioning/MOSS

Inputs (12)

NameTypeDefaultDescription
widthINT8961–16384—
heightINT11841–16384—
presetCOMBOCustom12 options: 1024 x 1024, 1536 x 1536, 2048 x 2048, 1024 x 1344, 1024 x 1536, 1152 x 1536, +6
layout_dataSTRING{"boxes":[]}—
camera_dataSTRING{"iso":"","shutter":"","aperture":"","focal_length":""}—
grid_modeCOMBOThirds3 options: Off, Thirds, Center Cross
ui_languageCOMBOAuto3 options: Auto, English, Japanese
camera_set_dataSTRING{"sets":[],"selected":""}—
canvas_preset_dataSTRING{"sets":[],"selected":""}—
width_overrideoptINT1–16384Overrides the Canvas width when connected.
height_overrideoptINT1–16384Overrides the Canvas height when connected.
reference_imageoptIMAGEOptional Canvas underlay. Connect Load Image IMAGE for a generation-free reference. Does not change Canvas dimensions or condition generation.

Outputs (1)

NameTypeDescription
framing_dataKREA2_ELEMENT_FRAMING_DATA—