FLUX2 Prompt Assembler π―
PromptAssembler
- subjects
- color_palette
- camera
- json_string
- json_object
This is the payoff node. Every other node in the ComfyUI-FLUX2-JSON pack builds a piece - scene, subjects, style, camera, palette - and FLUX2_PromptAssembler is where they all meet and get serialized into the final JSON prompt you feed FLUX.2. It's the terminal node, marked as an output node in the source, and nothing renders without it.
Why JSON at all? FLUX.2's text encoder is a vision-language model, and the community's hard-won finding is that structured JSON prompting works unusually well with it - nested descriptors for elements reduce ambiguity and concept bleed, which is exactly what kills plain comma prompts on multi-subject scenes. This pack is essentially an opinionated UI for that discovery: you fill in friendly dropdowns, it writes the JSON.
What you plug in
All nine component inputs are optional, which is the source of both its power and its first trap:
scene(STRING) - from FLUX2_SceneBuilder.subjects(FLUX2_SUBJECT_ARRAY) - from FLUX2_SubjectArray (which collects FLUX2_SubjectCreator objects).style(STRING) - from FLUX2_StyleSelector.color_palette(FLUX2_COLOR_ARRAY) - from FLUX2_ColorPalette or FLUX2_ColorPalettePreset.camera(FLUX2_CAMERA) - from FLUX2_CameraRig.lighting,mood,background,composition- free-text fields with no dedicated node in the pack (yet). These are where you can still hand-write, and they're genuinely useful: the README's product example lives entirely on scene + subjects + style + camera, butcompositionis the field people lean on for rules like "rule of thirds."
The two toggles:
pretty_print(default on) - indents the JSON so it's readable. Turn it off if you're pasting into something that wants compact JSON.remove_empty(default on) - strips empty fields recursively. This is the second trap: if you connect nothing and run it, you get{}. That's not a bug, it's the toggle working. Leave it on; empty fields in a structured prompt are just noise for the encoder.
The outputs
json_string(STRING) - the JSON, formatted. This is the one you actually use: copy it, or wire it into a text field / your FLUX.2 sampler workflow as the prompt.json_object(FLUX2_JSON) - the same data as a Python dict, offered for "further processing." Honest caveat: nothing else in this pack consumesFLUX2_JSON, so for now it's for automation or future nodes. Grab the string.
The node re-executes every time (IS_CHANGED always returns nan), so it stays live as you tweak upstream - handy, since you'll be fiddling with presets a lot.
Install
Same as the whole pack - once:
- ComfyUI Manager: search "FLUX2 Prompt Builder" β Install β restart.
- Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/ComfyUI-FLUX2-JSON.git
Stdlib only, zero model downloads. Under FLUX2_Prompt_Builder/Core.
The one thing to keep straight: this pack makes the prompt, not the image. You still need a real FLUX.2 workflow (Klein 4B/9B or Dev checkpoint) to render the JSON. But once you have that pipeline, this node is where "photorealistic product shot, structured, no concept bleed" stops being luck and becomes a repeatable formula.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| sceneopt | STRING | β | |
| subjectsopt | FLUX2_SUBJECT_ARRAY | β | |
| styleopt | STRING | β | |
| color_paletteopt | FLUX2_COLOR_ARRAY | β | |
| lightingopt | STRING | β | |
| moodopt | STRING | β | |
| backgroundopt | STRING | β | |
| compositionopt | STRING | β | |
| cameraopt | FLUX2_CAMERA | β | |
| pretty_printopt | BOOLEAN | true | β |
| remove_emptyopt | BOOLEAN | true | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| json_string | STRING | β |
| json_object | FLUX2_JSON | β |