D2 XY String To Plot
XY-compare whole multi-line prompts without the plot choking on line breaks
- x / y_list
XY plots split their axis lists on newlines - which is great until the thing you want to vary is a multi-line prompt, because then the plot sees your carefully formatted three-line prompt as three separate cells. D2 XY String To Plot exists precisely for that case: it collects up to 50 full text blocks and joins them into an x / y_list in a way the plot can consume, stripping each block's internal line breaks.
Where D2 XY List To Plot is the naive "\n".join adapter (fine for one-per-line values, breaks on embedded newlines), this node is the version built for whole-prompt comparison. If you're A/B testing complete prompts - each with its own line structure - this is the one to use.
The input and outputs
string_count- how many text inputs to show (1–50, default 3). The node growsstring_1,string_2, …string_Ninput fields accordingly.
Output: a single x / y_list string. Each input block becomes one cell of the plot, with its internal line breaks collapsed to single lines so the count stays correct.
How to use it
Set string_count to however many prompt variants you want to test. Fill each string_N with a complete prompt (newlines allowed inside). Connect the x / y_list output to the x_list or y_list of D2 XY Plot / D2 XY Plot Easy.
The one wiring detail that trips people: in D2 XY Plot Easy / Mini, set the axis type to STRING, then take the value out of x_other / y_other and connect that to the positive input of D2 KSampler. The plot's own positive input is the base prompt; the axis value replaces it cell by cell.
Installing
Part of the D2-nodes-ComfyUI pack - install the pack, not the node.
- ComfyUI Manager → search "D2-nodes-ComfyUI" → Install → restart.
- Or
cd ComfyUI/custom_nodes && git clone https://github.com/da2el-ai/D2-nodes-ComfyUIand restart.
Dependencies: piexif, charset-normalizer - nothing heavy, no model downloads. Pack gotcha: v32.0.0+ requires the newer ComfyUI V3 schema; older ComfyUI → pre-32.0.0 release.
Notes and gotchas
The line-collapsing is unconditional - each block becomes one line, so don't use this node if your per-cell value must keep line structure (BREAK tokens and similar). For single-line values, D2 XY List To Plot is the lighter option and does the same job. And since it's a "gather text" node, it only outputs when all string_N inputs are connected or filled; an empty block silently drops that cell. Fill them all, or count carefully.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| string_count | INT | 31–50 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| x / y_list | STRING | — |