Nodes/KJNodes for ComfyUI/MOSS-Image Prompt Builder KJ
ComfyUI Node Runs on cloud

MOSS-Image Prompt Builder KJ

Visual layout builder for MOSS-Image: the prompt becomes a JSON layout with the scene caption and one item per box (label object / character / text, caption, text to render, bbox in pixels from the canvas centre). Without boxes the plain prompt is output. Draw boxes on the canvas; select one to set its label, caption, (for text) the exact words to render, and optional tags and palette. meta / canvas / the summary palette row are the optional summary fields. width/height must match the generation size: the boxes are absolute pixels. Prompt weighting: write (phrase:weight) inside any caption and wire the prompt output into the text input of MOSS-Image Prompt Weight, which applies the weights and strips the markup. Canvas controls are the same as in the Ideogram 4 builder; right-click lists the boxes. Turn the prompt upsampler off when using layouts, it rewrites them.

By kijai·Created 3 years ago·Updated a day ago· 3,398
MOSS-Image Prompt Builder KJ
  • image
  • bboxes
  • prompt
  • preview
  • bboxes
  • width
  • height
◄width1024►
◄height1024►
◄prompt►
◄meta►
◄canvasnone►
◄elements_data►
◄style_palette_data►
◄bg_brightness25►
◄import_modewhen empty►
◄output_formatcompact►
◄import_json►
CategoryKJNodes/text

Inputs (13)

NameTypeDefaultDescription
widthINT102464–16384Generation width: the boxes are placed in its pixels. Multiples of 16.
heightINT102464–16384Generation height: the boxes are placed in its pixels. Multiples of 16.
promptSTRINGDescription of the whole scene and its style (summary.caption).
metaSTRINGOptional comma-separated tags for summary.meta, e.g. "poster" or "photograph" (blank = omitted).
canvasCOMBOnoneOptional summary.canvas: single image, multi_panel or collage (none = omitted).
elements_dataSTRINGSerialized boxes from the editor (managed by the node UI).
style_palette_dataSTRINGSerialized summary palette from the editor (managed by the node UI).
bg_brightnessINT250–100Background image brightness % (managed by the node UI slider).
import_modeCOMBOwhen emptyHow a wired import_json is used: 'when empty' only seeds the editor while it has no boxes (then the editor wins, so you can edit); 'always' makes the wired JSON authoritative.
output_formatSTRINGcompactOutput JSON formatting (set via the editor toolbar): 'compact' (default) or 'pretty' (indented, for readability).
imageoptIMAGEOptional background for the editor canvas (and behind the preview).
import_jsonoptSTRINGOptional: a MOSS-Image layout JSON. When connected, it loads into the editor and drives the output per 'import_mode'.
bboxesoptBOUNDING_BOX[object Object]Optional pixel-space boxes ({x, y, width, height}) used to seed the editor when it has no boxes. Ignored once boxes exist.

Outputs (5)

NameTypeDescription
promptSTRING—
previewIMAGE—
bboxesBOUNDING_BOX—
widthINT—
heightINT—