Py List To String
See What's Actually in That List — and Render It as Text
- value
- STRING
You've built a list somewhere in the graph - via Py String To List, a series of values, whatever - and now you want to actually see it, or send it somewhere that takes text. Py List To String is the node that converts a PYLIST into its STRING representation.
Half the time this node is a debugging aid: wire a list into it, feed the string into a text-display node, and suddenly the mystery of "what is in that list" is solved. The other half it's plumbing - some downstream nodes only accept strings.
How it works
It calls Python's str() on the list. So [1, 2, 3] becomes "[1, 2, 3]", and ["a", "b"] becomes "['a', 'b']" - note the Python single quotes around strings, not JSON double quotes. It's the literal Python representation, which is great for debugging (it's unambiguous about types) and slightly awkward if you were hoping for JSON. If you need JSON, that's a different conversion entirely.
Inputs and outputs
value- the PYLIST to convert.
Output: a STRING with the Python list representation.
Install
Part of HowToSD/ComfyUI-Data-Analysis. Manager: search "Data analysis" in the Custom Node Manager, install ComfyUI-Data-Analysis, restart, reload the browser tab. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis # README: example workflows rely on this folder name
pip install -r requirements.txt
No models, no GPU - trivial Python.
Common issues
The main surprise is quoting. Expect ['a', 'b'] with single quotes, and don't try to paste the result into a JSON consumer without converting. Also, if your list is huge, the string gets huge - it's a faithful repr, no truncation. And if you're round-tripping through Py String To List, that node expects a valid Python list literal, which is exactly what this node outputs, so the pair works cleanly. If the list is empty, you get "[]" - which is at least honest.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | PYLIST | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |