ComfyUI Node

AK XZ Batch Prompts

A/B test prompts without rebuilding your graph

By akawana·Created 9 months ago·Updated 7 months ago· 4
AK XZ Batch Prompts
  • clip
  • positives
  • negatives
  • xz_config
pos_0
neg_0
xz_config
pos_1
neg_1
pos_2
neg_2
pos_3
neg_3
pos_4
neg_4
pos_5
neg_5
pos_6
neg_6
pos_7
neg_7
pos_8
neg_8
pos_9
neg_9
pos_10
neg_10

Prompt A/B testing in stock ComfyUI is miserable. You change the text, rerun, change it back, rerun - and because you're fiddling by hand you can't trust that the only difference between two outputs is the wording. AK XZ Batch Prompts from ComfyUI-AK-XZ-Axis lets you queue up to eleven prompt pairs, run them in one go on the same seed, and get back a labeled comparison instead of a guess.

What it does

You connect a clip (from your checkpoint loader), type in a positive and negative prompt for pair 0, and the node CLIP-encodes them for you - that's a genuine convenience, because it means you're working with plain text, not hand-building conditioning. Wire the two list outputs into your KSampler's positive and negative inputs and it runs once per pair.

The slots go from pos_0/neg_0 (required) through pos_10/neg_10. The optional ones only appear as inputs once a full pair is connected - the pack ships a small JS extension that adds and removes sockets as you fill them, so you're not staring at eleven empty slots. That's the "dynamic inputs" the README mentions, and it works the way you'd hope.

The usual pattern

Everyone reaches for the same shape: keep the same negative on every pair, vary only the positive. The node is built for this - it caches encoded conditioning, so identical text is only encoded once, and if a negative is empty it just labels the image "Pos: ..." without the "|| Neg: ..." suffix. If you do vary the negative too, it'll happily carry it through as its own parameter.

The X/Z behavior (the part to read twice)

  • X mode (no xz_config connected): each prompt pair becomes one labeled image in a sweep. Simple and complete.
  • Z mode (xz_config connected): the node pairs up with whatever X-axis sweep is already running and assigns each prompt to a Z-slot - so you can run, say, a cfg sweep where every cfg value is generated once per prompt variant. It pads or trims the prompt list to match the number of images in the X config, which is exactly how a "cfg × prompt" matrix falls out of the X+Z design.

Inputs and outputs that matter

Inputs you set: clip (one connection, mandatory), and the pos_N/neg_N text pairs. The xz_config input only matters once you're stacking a Z-axis on top of an existing sweep.

Outputs:

  • positives (CONDITIONING list) → KSampler positive
  • negatives (CONDITIONING list) → KSampler negative
  • xz_config (STRING) → AK XZ Axis Plot for the labeled output

Install

ComfyUI Manager → search AK XZ → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/akawana/ComfyUI-AK-XZ-Axis.git

Restart, and load xz_workflow_prompts.json from the repo's /workflows/ folder for a working example. No pip requirements, no model downloads - the pack is dependency-free beyond ComfyUI itself.

The honest caveats

Because CLIP encoding happens inside this node, the conditioning output is the pack's own flavor of the standard structure - fine for stock KSamplers, but if your workflow needs advanced tricks (BREAK, per-token weighting via custom encoders, Flux-style prompt schedules), those live upstream of this node anyway, so encode your fancy stuff yourself and use the Range nodes for the X axis instead. Also keep the usual prompt-testing discipline from the KB's prompt-engineering material: lock the seed and vary only the wording, or the plot will lie to you. And note the pack is young - December 2025, thin community footprint - so the README plus the demo workflows are the whole manual.

CategoryAK/XZ Axis

Inputs (24)

NameTypeDefaultDescription
clipCLIP
pos_0STRING
neg_0STRING
xz_configoptSTRING
pos_1optSTRING
neg_1optSTRING
pos_2optSTRING
neg_2optSTRING
pos_3optSTRING
neg_3optSTRING
pos_4optSTRING
neg_4optSTRING
pos_5optSTRING
neg_5optSTRING
pos_6optSTRING
neg_6optSTRING
pos_7optSTRING
neg_7optSTRING
pos_8optSTRING
neg_8optSTRING
pos_9optSTRING
neg_9optSTRING
pos_10optSTRING
neg_10optSTRING

Outputs (3)

NameTypeDescription
positivesCONDITIONING
negativesCONDITIONING
xz_configSTRING