KJNodes/textgenerated

MOSS-Image Prompt Builder KJ(MossImagePromptBuilderKJ)

The MOSS-Image Prompt Builder KJ node is a visual layout builder for MOSS-Image.

Moss Image Prompt Builder KJ

image
bboxes
prompt
preview
bboxes
width
height
width
1024
height
1024
prompt
STRING
meta
STRING
canvas
none
import_json
STRING
elements_data
STRING
style_palette_data
STRING
bg_brightness
25
import_mode
when empty
output_format
compact
KJNodes

Description

The MOSS-Image Prompt Builder KJ node is a visual layout builder for MOSS-Image. It turns a scene prompt and boxes drawn on an editor canvas into a JSON layout containing the scene caption and one item per box. Each box item can describe a label such as an object, character, or text, along with its caption, the exact text to render, and a bounding box in pixels from the canvas centre. If no boxes are present, the node simply outputs the plain prompt.

Draw boxes directly on the canvas; select a box to set its label, caption, the exact words to render for text boxes, and optional tags and palette. The meta, canvas, and palette row are optional summary fields. The configured width and height must match the generation size, because the boxes are stored as absolute pixel coordinates.

Canvas controls are the same as in the Ideogram 4 builder, and right-clicking lists the boxes. When using layouts, turn the prompt upsampler off because it rewrites them.

Inputs

Layout Dimensions

  • width (INT, default 1024, min 64, max 16384, step 16)
    Generation width in pixels. Boxes are placed in this pixel space, so this must match the intended generation width. Values should be multiples of 16.

  • height (INT, default 1024, min 64, max 16384, step 16)
    Generation height in pixels. Boxes are placed in this pixel space, so this must match the intended generation height. Values should be multiples of 16.

Scene and Summary

  • prompt (STRING, default empty)
    Description of the whole scene and its style. This becomes summary.caption.

  • meta (STRING, default empty)
    Optional comma-separated tags for summary.meta, for example "poster" or "photograph". Leave blank to omit this field.

  • canvas (COMBO, default "none")
    Optional summary.canvas value. Supported choices are single image, multi_panel, and collage. none omits the field.

Optional Editor Inputs

  • image (IMAGE, optional)
    Optional background for the editor canvas and behind the preview.

  • import_json (STRING, optional, default empty)
    Optional MOSS-Image layout JSON. When connected, it loads into the editor and drives the output according to import_mode.

  • bboxes (BOUNDINGBOX, optional)
    Optional pixel-space boxes in {x, y, width, height} form, used to seed the editor when it has no boxes. Once boxes exist in the editor, this input is ignored.

UI-Managed Inputs

These inputs are normally managed by the node UI rather than edited by hand.

  • elements_data (STRING, default empty)
    Serialized boxes from the editor.

  • style_palette_data (STRING, default empty)
    Serialized summary palette from the editor.

  • bg_brightness (INT, default 25, min 0, max 100)
    Background image brightness percentage, controlled by the node UI slider.

  • import_mode (COMBO, default "when empty", options "when empty" / "always")
    Controls how a wired import_json is used.

    • when empty only seeds the editor while it has no boxes; after that, the editor wins so you can edit freely.
    • always makes the wired JSON authoritative.
  • output_format (STRING, default "compact")
    Output JSON formatting, set via the editor toolbar. Use compact for the default compact output or pretty for indented, more readable JSON.

Outputs

The node returns five outputs:

  1. STRING: The MOSS-Image prompt. When boxes are present this is the JSON layout; without boxes it is the plain prompt. The JSON formatting follows output_format.
  2. IMAGE: The editor canvas/preview image, including the optional background image when supplied.
  3. BOUNDINGBOX: The current pixel-space boxes from the editor.
  4. INT: The working width used by the builder.
  5. INT: The working height used by the builder.

Usage Notes

  • Set width and height to the exact generation size before placing boxes. The boxes are absolute pixel coordinates, so a mismatch will produce an incorrectly scaled layout.
  • Draw boxes on the canvas and select one to edit its label, caption, text content, optional tags, and palette.
  • Use text boxes when you need to provide the exact words to render. For other box types, use the caption to describe the object or character.
  • If the layout is empty, the node outputs the plain prompt instead of a JSON layout.
  • To apply prompt weighting, write (phrase:weight) inside any caption and wire the prompt output into the text input of MOSS-Image Prompt Weight. That node applies the weights and strips the markup.
  • Turn the prompt upsampler off when using layouts, because it rewrites them.
  • A wired import_json can seed or drive the editor depending on import_mode. Use when empty if you want imported boxes only as a starting point, or always if the external JSON should remain authoritative.
  • bboxes only seed the editor while it is empty. Once boxes exist, they are ignored.
  • Right-click the canvas to list the boxes. Canvas controls match the Ideogram 4 builder.

Comments

Sign in with GitHub to join the discussion.

Loading comments…