Nodes/MOSS BBOX Prompter/MOSS BBOX Export
ComfyUI Node

MOSS BBOX Export

The node that decides what MOSS-Image actually reads

By ukr8b3g-cmyk·Created 10 days ago·Updated 3 days ago· 6
MOSS BBOX Export
  • framing_data
  • prompt_ui_data
  • prompt
  • width
  • height
  • moss_json
◄auto_position_hintfalse►
◄output_modehybrid►
◄text_modelegacy►
◄text_stylereadable text with black outline►

Ignore the class name - nothing here talks to Krea2. MOSS BBOX Export (MOSSFromKrea2) is the final stage of the current MOSS BBOX pipeline: canvas in one hand, prompter in the other, and it hands you the prompt string plus the latent dimensions.

This is the node you'll actually tune, because it's where your boxes stop being a drawing and become conditioning.

Why a separate export node

MOSS-Image wants structured captions, not vibes. Give it a summary plus typed items with centralized pixel yxyx boxes and it will place things; give it plain prose and you're leaving the model's main trick on the table. (Ideogram 4 is the other clear example of a model trained on a JSON caption schema, and it's why canvas prompt-builders keep getting written.) That structure is verbose and fiddly, so you want to author it visually and let a node compile it.

Splitting compile off from authoring buys you the freedom to change format without redrawing anything. Same boxes, four different payloads.

The three settings that matter

output_mode is the one to understand:

  • hybrid - prose listing each box, then the Layout JSON. The default, and the one the author's original two-node setups produced.
  • caption - prose only, no JSON, no editor color labels. Reads like a normal descriptive prompt that happens to be ordered by your boxes.
  • layout_json - compact Layout JSON only. Unboxed descriptions can't be represented, so they're dropped with a warning.
  • auto - layout_json when there are boxes, caption when there aren't. Sensible for reusable workflows.

text_mode only touches Text-type cards. legacy expects visible wording | appearance and splits on the pipe, stripping a text: prefix if you use one. literal takes the card verbatim - quotes, pipes, leading spaces, line breaks all survive as real characters - and puts appearance elsewhere.

text_style is that "elsewhere": a shared description applied to every Text item in literal mode. Default readable text with black outline. A color card set to Individual settings overrides it for that color, with its typeface/weight/color/extra folded into a plain caption. These are descriptive hints to the model, not font files - you are asking for serif lettering, not installing a font.

auto_position_hint adds a phrase derived from each box's live position ("lower-left area") to the prose. It doesn't move boxes, and does nothing for layout_json.

How it compiles

Scene and background from the prompter become the summary, joined; camera values from the canvas's camera panel are appended as a Camera settings: ISO …, aperture … sentence. Then each color is resolved: character/object captions get framing and angle hints appended as ordinary prose (pick "Close-up" and the caption grows a close-up description), text captions go through the legacy/literal split above. If a canvas box carries its own per-ID prompt card, that card wins over its color's defaults - which is how you describe three different people with three blue boxes.

Every box is then converted: sort the edges, floor the starts, ceil the ends, subtract height // 2 and width // 2. Centralized pixels, no 0–1000 grid round trip - expect at most a pixel of drift from the native MOSS layout node.

Inputs and outputs

Required: framing_data (KREA2_ELEMENT_FRAMING_DATA, from MOSS BBOX Canvas), prompt_ui_data (KREA2_ELEMENT_PROMPT_DATA, from MOSS BBOX Prompter), and auto_position_hint.

Optional: output_mode, text_mode, text_style.

Outputs: prompt → CLIP Text Encode positive, and also into Save WEBP Meta's positive_text if you want the exact generated prompt recoverable later; width and height → Empty Flux 2 Latent; moss_json → the Layout object alone, on its own socket.

Install

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

Restart, Ctrl+F5. No pip dependencies, no bundled model downloads. The example workflows also need rgthree-comfy for its Power Lora Loader - standard MOSS at 25 steps / CFG 2.5, or the DMD LoRA at 0.7 with 8 steps / CFG 1.

Where it bites

"Connect the MOSS BBOX Canvas framing_data output." You fed it the legacy canvas's canvas_data, or an old saved workflow's export input. Check the version tags on both wires; the Export validates krea2_element_framing_v1 and krea2_element_prompt_ui_v1.

Read the log, not just the image. Nonfatal warnings are printed as MOSS BBOX: … - zero-area boxes, boxes outside the canvas, precision-collapsed boxes, empty visible text, descriptions with no box. It never clips or deletes anything; it exports what you drew and tells you it was a bad idea.

layout_json losing your text cards. Text with no box can't exist in the schema. Use hybrid if unboxed wording matters.

"I changed a setting and nothing happened." Restart the backend and refresh the browser after updating this pack; widget additions need both.

Sizes must be multiples of 16. 896×1184 default, and the latent node truncates otherwise.

And the honest limit: boxes guide, they don't pin. The author's own seeding tests had a boxed suitcase slide toward the person. If you need a subject exactly there, this is steering, not compositing.

Categoryconditioning/MOSS

Inputs (6)

NameTypeDefaultDescription
framing_dataKREA2_ELEMENT_FRAMING_DATA—
prompt_ui_dataKREA2_ELEMENT_PROMPT_DATA—
auto_position_hintBOOLEANfalseAdd position words derived from boxes to caption/hybrid prose. Does not move boxes; no effect on layout_json or auto with boxes.
output_modeoptCOMBOhybridhybrid keeps the existing output; caption is prose; layout_json is compact JSON; auto uses JSON when boxes exist and prose otherwise.
text_modeoptCOMBOlegacylegacy: visible words | appearance. literal: each Text card is exact visible text, including quotes, spaces, line breaks and |.
text_styleoptSTRINGreadable text with black outlineShared Text appearance in literal mode. Individual settings on a Text card replace this for that color. Visible wording stays separate.

Outputs (4)

NameTypeDescription
promptSTRING—
widthINT—
heightINT—
moss_jsonSTRING—