KIE • Variation Matrix
Four prompts that differ by exactly one thing
- take_1_prompt
- take_2_prompt
- take_3_prompt
- take_4_prompt
- matrix_json
Prompt comparison is usually a mess. You tweak three things at once, one image is better, and you have no idea which tweak did it. KIE • Variation Matrix forces the discipline: one base prompt, one set of things that must not change, and up to four takes that each differ by a single specified condition.
Local, free, no API call. It builds strings and returns a manifest - but those four strings are meant to go into four paid generations, so the shape it produces is doing real work.
How the prompts are assembled
Every take prompt is the same three-part join:
<base prompt>
Keep constant across takes: <fixed_constraints>
Change for take 2 only: <take_2_change>
That's the whole mechanism, and it's why it works. The "keep constant" clause is your anti-drift insurance - tell the model the character, wardrobe, location and lighting are locked, and then change one axis. Framing, lighting direction, lens, expression, time of day: pick one per take.
If a take's change field is empty, that take's prompt output is an empty string and no record is written for it. So a three-take matrix genuinely produces a three-take manifest, not four with a phantom. The Variation Board downstream reads that manifest, which is how it knows which numbered images to expect.
Alongside the prompts you get matrix_json - the manifest. It carries the base prompt, the fixed constraints, a takes array of {take, delta, prompt} records, and a flat statement of method: connect each prompt to the same model and settings, and expect provider seeds and reference behaviour to vary. No fake confidence score, no "quality" field.
Inputs and outputs
- base_prompt - required, multiline. The scene, as you'd normally write it.
- take_1_change - required, default
wide framing. At least one change must be non-empty or the node errors; this is the "deliberate variation" requirement, not a bug. - fixed_constraints - optional, default
same character, wardrobe, location, and lighting. - take_2_change / take_3_change / take_4_change - optional, defaults
medium framing,close-up framing, empty.
Limits: the base prompt caps at 15,000 characters and each individual change at 3,000. Length errors name the offending take.
Outputs are take_1_prompt through take_4_prompt (plain strings) plus matrix_json. Wire each prompt to whichever paid generation node you're testing - a Seedream image node, a Kling or Seedance video node - and wire all four result images into KIE • Variation Board with matrix_json, so the comparison lands on one durable sheet.
The workflow this is built for
You're choosing a framing, a look, or a lighting direction, not generating four deliverables. Run all four through the same model, same reference images, same aspect ratio, and only then compare. The node even says so in its manifest, and it's right: provider seeds and reference handling vary between models, so cross-model comparisons are mush. One model, one variable.
Connect only the takes you intend to pay for. Four takes on a video model is four video jobs - real money. If the point is to pick a look before committing, run one image model first, then take the winner forward.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
cd ComfyUI-KIE-Nodes-Next
pip install -r requirements.txt
Restart, then find it under KIE Next / Studio / Production. No key required for this node, no dependencies beyond the pack's base set, no model downloads.
Gotchas
"A variation matrix needs a base prompt." You left it empty - that's the only required text field.
"Add at least one deliberate variation." All four change fields blank. Give take 1 something.
Your takes aren't comparable. Two changes in one take field, or the changed thing contradicts a fixed_constraints item. The node can't catch that - prompt wording is the part you still own.
Vertically stacked outputs. Take 2 through 4 are optional inputs on the board, not a list. If you only generate three images, connect three sockets; the board adapts to the manifest.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| base_prompt | STRING | — | |
| take_1_change | STRING | wide framing | — |
| fixed_constraintsopt | STRING | same character, wardrobe, location, and lighting | — |
| take_2_changeopt | STRING | medium framing | — |
| take_3_changeopt | STRING | close-up framing | — |
| take_4_changeopt | STRING | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| take_1_prompt | STRING | — |
| take_2_prompt | STRING | — |
| take_3_prompt | STRING | — |
| take_4_prompt | STRING | — |
| matrix_json | STRING | — |