ComfyUI Node
CV Array To Text
Formats an array as a text table - the way measurements LEAVE the graph. Wire it into core 'Preview as Text' to read the numbers, or into 'Basic data handling: save STRING to file' to write a .csv (this node deliberately has no file picker - the helper pack already does disk IO). 'Parse Matrix' is the return leg, so a table can be written, re-read and plotted. Unlike 'Inspect CV Data', which SUMMARISES, this emits every value.
CV Array To Text
- nparray
- text
- rows
- truncated
◄format▾►
◄decimals4►
◄header►
◄max_elements100000►
Categoryimage/CV/low-level
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| nparray | NPARRAY | Array to format. 1-D becomes one row, 2-D one row per row; anything higher is flattened to (-1, last axis) for the table formats and kept fully nested for JSON. | |
| format | COMBO | CSV/TSV/plain emit one line per row with the chosen separator - 'Parse Matrix' reads all three back. JSON emits a nested list, which core 'Extract Text from JSON' and the chart nodes can consume. | |
| decimals | INT | 4-1–17 | Digits after the decimal point for float arrays. -1 prints full repeatable precision (17 digits) - use it when the text is a round trip, not a report. Integer arrays always print exactly. |
| headeropt | STRING | Optional column names, comma-separated, written as the first line (table formats only). Keep it ASCII - workflow JSON is read with the Windows codepage. | |
| max_elementsopt | INT | 1000001–10000000 | Safety cap: stop after this many values and report it on 'truncated'. Formatting a whole image would produce a multi-megabyte string that the UI has to carry. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | The formatted table. Newline-separated; no trailing newline, so 'Parse Matrix' reads it back unchanged. |
| rows | INT | Number of data rows written (excluding the header). |
| truncated | BOOLEAN | True when 'max_elements' cut the table short - the text is then incomplete and must not be round-tripped. |