PVL String To String List
Turn one string into a list, without the manual labour
- STRING
Sometimes you have one string that's really several strings wearing a trench coat - a comma-separated list, a batch of tags, several values from an API packed into a single text field. PVL String To String List splits that string on a delimiter and emits a true list, the kind that wildcard loops and batch processors actually want.
It's from pvlprk/comfyui-pvl-api-nodes ("ComfyUI Assistant Node") and it's the forward half of the pack's string-list round trip: this node splits one string into a list; PVL String List To String joins a list back into one. Learn both and you've got a general-purpose "string ↔ list" bridge.
How it works
text- the input string.delimiter- default[++], the pack's bracket convention (keeps commas and pipes in your content from accidentally splitting it).- Output - a
STRINGlist (OUTPUT_IS_LISTis on), so the port is the "list" flavor.
Splitting is plain str.split(delimiter). Two defensive details: None input becomes a single-item list with an empty string, and an empty delimiter deliberately does not split into characters - you get the whole string back as one item. That last one is worth knowing, because a naive "".join-style split would have shredded your text into letters.
Why you'd use it
The classic pattern is feeding a per-item workflow. Split a list of LoRA names or style keywords into a list, then run that through anything that iterates over items - batch text processing, per-item conditioning, a wildcard expansion. It's also the way to prepare data before a JSON or CSV payload: take your packed string, split it, rejoin with a different delimiter via the inverse node, and you've restructured your data without touching a Python node.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/pvlprk/comfyui-pvl-api-nodes
restart, or install via ComfyUI Manager (search "ComfyUI Assistant Node"). No models, no dependencies beyond Python's built-in string methods.
The gotchas
- The output is a list port, not a single string. Wire it into something expecting plain
STRINGand it won't connect - you need the list version of the target input, or collapse it with String List To String first. - The delimiter is literal and exact.
[++]won't match[ + + ], and switching to a comma means any comma inside your content splits too. That's the trade the bracket convention buys you. - No trimming. If your input has
"a, b, c"with spaces, you'll get items with leading spaces. The pack's PVL Split String trims its parts; this node doesn't - split-and-strip isn't its job.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| delimiter | STRING | [++] | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |