Nodes/MOSS BBOX Prompter/MOSS BBOX Preview
ComfyUI Node

MOSS BBOX Preview

Did your boxes actually do anything?

By ukr8b3g-cmyk·Created 10 days ago·Updated 3 days ago· 6
MOSS BBOX Preview
  • images
  • framing_data
  • images

Boxes in, image out, and no way to tell if the composition you drew is the composition you got. That's the gap MOSS BBOX Preview fills: it shows the generated image with your requested boxes overlaid on top, inside the node, so you can judge adherence in one glance instead of holding two screenshots in your head.

It is the one node in this pack that both current and legacy workflows share, and it's the one you'll open every single run.

Why this is the useful one

Layout-conditioned models are not layout-obedient models. You hand MOSS-Image a character box on the left and a text box across the top, and most of the time you get roughly that - but "roughly" is doing real work in that sentence. The pack author's own GPU tests found a centrally-boxed suitcase drifting toward the person in the scene. Without an overlay you'd blame your prompt; with one you can see instantly that the box needs to move.

Same story with the general regional-prompting habit: you only learn what a layout machine actually respects by comparing request to result, side by side, repeatedly.

How it works (and why it can't hurt your image)

Two inputs, one output, and a fair amount of restraint.

framing_data arrives from the canvas and gets validated for the expected version tag. images is any IMAGE batch. For each frame the node writes a temporary WebP thumbnail (capped at 2048px on the long side) into ComfyUI's temp directory and returns it under a private UI key, alongside the layout and the original image dimensions. Your browser draws the colored borders over that thumbnail.

Which means: the borders are never baked into anything. The images output is the original tensor, untouched - the code does non-inplace tensor ops and returns images unchanged, so you can put Preview between generation and Save and your saved file stays clean. Resolution and quality downstream are unaffected. The boxes are a browser overlay on a throwaway thumbnail.

It's also an output node (OUTPUT_NODE = True), so it always executes when reached - no need to bolt a preview flag onto it.

Wiring

New Subgraph (or VAE Decode) IMAGE ─┬─→ Save Animated WEBP images
                                    └─→ MOSS BBOX Preview images
MOSSSharedCanvas framing_data ──────┬─→ MOSS BBOX Export framing_data
                                    └─→ MOSS BBOX Preview framing_data

Branch, don't reroute through: both the Export and the Preview want the same framing_data, and one output can feed both. And do not wire the Preview's images output back toward the canvas's reference_image input - that's a cycle, and ComfyUI will refuse to queue it.

Input type gotcha: framing_data is KREA2_ELEMENT_FRAMING_DATA, which is what MOSSSharedCanvas emits. The legacy MOSSBBoxCanvas emits canvas_data (MOSS_BBOX_LAYOUT) instead, so it simply won't connect here. If you're reviving an old two-node workflow and want the overlay, swap in the shared canvas.

Showing, hiding, and inspecting old images

Show Boxes and Opacity are display state, not generation settings. They act immediately, queue nothing, and are saved per node - turning boxes off stays off for the next result, which is what you want once you're just checking pixels.

To inspect an image you already generated, don't re-run anything. Build a two-node graph: Load Image → images, MOSS BBOX Canvas with the layout you used → framing_data, then Run. No sampler, no model. A different layout just overlays different requested boxes - this node doesn't detect subjects or recover boxes from a photo, and it never has.

Install

Same as the rest of the pack: no dependencies, no downloads.

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

Restart ComfyUI and Ctrl+F5. The node registers from v1.0.3 onward, so an older install of the pack won't have it - update the clone with git pull, restart, refresh.

When it shows nothing

Empty node, no image. It's muted or bypassed, one of the two inputs isn't connected, or execution never reached it. Preview runs after sampling; if the sampler errored, there's nothing to show.

Image but no colored borders. Show Boxes is off, Opacity is at 0, or the connected canvas genuinely has no boxes. All three look identical, and all three are five seconds to check.

It worked yesterday, now the preview is a broken thumbnail. Temporary previews live in ComfyUI's temp directory and get cleared. Regenerate, or use the Load Image route above to recreate the overlay from the saved file.

Categoryimage/MOSS

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEConnect generation subgraph IMAGE, VAE Decode IMAGE, or Load Image IMAGE. The preview appears inside this node after execution.
framing_dataKREA2_ELEMENT_FRAMING_DATABranch MOSS BBOX Canvas framing_data here; keep its Export connection.

Outputs (1)

NameTypeDescription
imagesIMAGE—