Nodes/comfyui_cv/CV Array To Text
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.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Array To Text
  • nparray
  • text
  • rows
  • truncated
format
decimals4
header
max_elements100000
Categoryimage/CV/low-level

Inputs (5)

NameTypeDefaultDescription
nparrayNPARRAYArray 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.
formatCOMBOCSV/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.
decimalsINT4-1–17Digits 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.
headeroptSTRINGOptional column names, comma-separated, written as the first line (table formats only). Keep it ASCII - workflow JSON is read with the Windows codepage.
max_elementsoptINT1000001–10000000Safety 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)

NameTypeDescription
textSTRINGThe formatted table. Newline-separated; no trailing newline, so 'Parse Matrix' reads it back unchanged.
rowsINTNumber of data rows written (excluding the header).
truncatedBOOLEANTrue when 'max_elements' cut the table short - the text is then incomplete and must not be round-tripped.