Nodes/ComfyUI-FLUX2-JSON/FLUX2 Subject Array πŸ“‹
ComfyUI Node

FLUX2 Subject Array πŸ“‹

FLUX2 Subject Array is how multi-subject FLUX.2 scenes stay sane

By MushroomFleetΒ·Created 9 months agoΒ·Updated 5 months agoΒ· 27
FLUX2 Subject Array πŸ“‹
  • subject_1
  • subject_2
  • subject_3
  • subject_4
  • subject_5
  • subject_6
  • subject_7
  • subject_8
  • subject_9
  • subject_10
  • subject_11
  • subject_12
  • subjects
  • subject_count
  • summary

Multi-subject scenes are where FLUX.2 prompts fall apart - write "a mug, a laptop, and a plant" in one breath and the model smears them together. FLUX2_SubjectArray is the node that keeps them apart. It collects up to twelve subject objects from FLUX2_SubjectCreator into one ordered array, which becomes the subjects field of your final JSON prompt. Order is the point: the README is explicit that subject_1 is typically the primary/foreground element, and the model reads it as such.

It's part of ComfyUI-FLUX2-JSON (MushroomFleet's "FLUX2 Prompt Builder"), under FLUX2_Prompt_Builder/Subjects. It's a pure collector node - no prompt text enters or leaves here, just structured subject objects.

The inputs

Twelve inputs, subject_1 through subject_12, each accepting a FLUX2_SUBJECT object straight off a FLUX2_SubjectCreator node. All optional. Empty slots are filtered out automatically - the source iterates the inputs, keeps only the non-None ones, and preserves slot order. So you can wire subjects into slots 1, 5, and 9 and the array comes out in that order, no gaps. There are no string fields here at all; if you want a description that isn't a SubjectCreator object, this node won't take it.

The three outputs

  • subjects (FLUX2_SUBJECT_ARRAY) - the ordered list. This is the one that matters: wire it into FLUX2_PromptAssembler's subjects input.
  • subject_count (INT) - how many subjects survived the filter. Boring but useful when you're scripting or just confirming a connection took.
  • summary (STRING) - a numbered overview: "1. Minimalist ceramic coffee mug... / 2. Sleek modern laptop...". Descriptions longer than 50 characters get truncated to 47 plus an ellipsis, so it's for eyeballing, not for the prompt. Pin it to a text node if you want the scene checklist on screen.

The node re-executes on every change (its IS_CHANGED returns nan), so the summary stays in sync while you shuffle subjects around.

Install

Same one-time pack install:

  • ComfyUI Manager: search "FLUX2 Prompt Builder" β†’ Install β†’ restart.
  • Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/ComfyUI-FLUX2-JSON.git

No models, no dependencies beyond stdlib. Under FLUX2_Prompt_Builder/Subjects.

The trap: order is a promise you're making

Because the array preserves slot order and the encoder treats it as a list, the FIRST subject you connect is the one the model treats as the star of the shot - foreground, most detailed, most prominent. The README's example workflow deliberately puts the coffee cup in subject_1 over the laptop and plant, foreground-priority. If you connect them in a random order and wonder why the model keeps framing the plant, that's your answer: reorder the slots, don't fight it with prompt words. And if a subject renders wrong, fix it at the source - the SubjectCreator that made it - not by piling adjectives onto the array. The whole point of this structure is that each object stays a clean, separate block the VLM can read without ambiguity.

CategoryFLUX2_Prompt_Builder/Subjects

Inputs (12)

NameTypeDefaultDescription
subject_1optFLUX2_SUBJECTβ€”
subject_2optFLUX2_SUBJECTβ€”
subject_3optFLUX2_SUBJECTβ€”
subject_4optFLUX2_SUBJECTβ€”
subject_5optFLUX2_SUBJECTβ€”
subject_6optFLUX2_SUBJECTβ€”
subject_7optFLUX2_SUBJECTβ€”
subject_8optFLUX2_SUBJECTβ€”
subject_9optFLUX2_SUBJECTβ€”
subject_10optFLUX2_SUBJECTβ€”
subject_11optFLUX2_SUBJECTβ€”
subject_12optFLUX2_SUBJECTβ€”

Outputs (3)

NameTypeDescription
subjectsFLUX2_SUBJECT_ARRAYβ€”
subject_countINTβ€”
summarySTRINGβ€”