KJNodes/textgenerated

FLUX.3 Prompt Builder KJ(Flux3PromptBuilderKJ)

FLUX. 3 Prompt Builder KJ (Flux3PromptBuilderKJ, category KJNodes/text) is a visual layout builder for FLUX. 3 prompts.

Flux3 Prompt Builder KJ

image
references
bboxes
image
prompt
preview
bboxes
width
height
upsampler_input
width
1024
height
1024
prompt
STRING
import_caption
STRING
elements_data
STRING
bg_brightness
25
import_mode
when empty
KJNodes

Description

FLUX.3 Prompt Builder KJ (Flux3PromptBuilderKJ, category KJNodes/text) is a visual layout builder for FLUX.3 prompts. Draw boxes on the canvas, give each box an id and a description, and the node appends those boxes to the prompt as a JSON table using a 0–1000 coordinate grid. Cite a box in the prompt as <id> to tie words to that region.

The node can work with reference images as well. Each reference gets its own canvas (selectable from the toolbar), in the same order the model receives them (ref_1 first). A box drawn on a reference marks where an object is in that reference; select the box, switch to the output canvas, and draw again to place that object there. A box only on a reference means the object is removed; a box only on the output means it is new.

Inputs

Canvas

  • width (INT, default 1024, min 64, max 16384, step 16): Output canvas width, and therefore the aspect the boxes are drawn on. Values are in multiples of 16.
  • height (INT, default 1024, min 64, max 16384, step 16): Output canvas height, and therefore the aspect the boxes are drawn on. Values are in multiples of 16.

Prompt and Layout Data

  • prompt (STRING, default empty): The prompt text. The box table is appended after it. Cite boxes in this text using <id>.
  • elements_data (STRING, default empty): Serialized boxes from the editor. This is managed by the node UI and normally should not be edited manually.
  • bboxes (BOUNDINGBOX, optional): Optional pixel-space boxes ({x, y, width, height}) used to seed the output canvas when the editor has no boxes.

Images and References

  • image (IMAGE, optional): Optional background for the output canvas, also shown behind the preview. Its brightness is controlled by bg_brightness.
  • references (AUTOGROW, required): Reference images, in the order the model receives them (ref_1 = ref_image_0). Each reference gets its own canvas in the editor.
  • image (IMAGE, required): A required IMAGE input exposed by the node. The source definition lists both an optional background image and this required image input; check the sockets in ComfyUI when wiring so the optional background and the required image connection are not confused.

Import and Preview

  • import_caption (STRING, optional, default empty): An optional FLUX.3 caption (prompt plus box table), such as the output of a prompt upsampler. When connected, it loads into the editor and drives the output according to import_mode.
  • import_mode (COMBO, default "when empty", options "when empty" / "always"): Controls how a wired import_caption is used. In "when empty" mode it only seeds the editor while the editor has no boxes; after that the editor wins, so you can edit the layout. In "always" mode the wired caption is authoritative.
  • bg_brightness (INT, default 25, min 0, max 100): Background image brightness percentage. This is managed by the node UI slider and applies to the optional background image.

Outputs

The node returns six outputs, in order:

  1. STRING: The final prompt text, with the box table appended after the prompt value.
  2. IMAGE: A rendered canvas/preview image of the layout.
  3. BOUNDINGBOX: The boxes from the output canvas as bounding-box data, using pixel-space {x, y, width, height} boxes.
  4. INT: The canvas width.
  5. INT: The canvas height.
  6. STRING: The serialized editor state (elements_data), which can be reused or fed back into another builder.

Usage Notes

  • Draw boxes on the output canvas, then give each box an id and a description. Reference the box in prompt as <id> so the model ties those words to that region.
  • When using reference images, wire them in the same order they are given to the model. ref_1 corresponds to ref_image_0. Use the toolbar view selector to switch between the output canvas and each reference canvas.
  • To move or place an object, draw its box on the reference, select that box, switch to the output canvas, and draw again. A box present only on a reference means the object is removed; a box present only on the output means it is new.
  • The canvas controls are the same as in the Ideogram 4 builder. Right-click lists the boxes on the current canvas.
  • If bboxes is connected and the editor has no boxes, the pixel-space boxes seed the output canvas.
  • With import_mode set to "when empty", a wired import_caption seeds the editor only while it is empty and then lets you edit. Set it to "always" when the wired caption should remain authoritative.
  • Use multiples of 16 for width and height; the node accepts values from 64 to 16384.

Comments

Sign in with GitHub to join the discussion.

Loading comments…