Nodes/ComfyUI-JDCN/LogicUtil_Convert Combo to String
ComfyUI Node

LogicUtil_Convert Combo to String

Join a combo/list into one string with your own separator

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Convert Combo to String
  • combo
  • STRING
separator$

ComfyUI's combo widgets and list-typed outputs are great inside the graph and useless the moment a node wants a single string. LogicUtil_Convert Combo to String takes a list (or combo) on combo, glues every element together with whatever separator you pick, and hands you one STRING on the other side. It's the LogicUtil-set answer to the pack's own JDCN_ListToString, with the difference that the separator is yours to choose instead of being hard-wired to newlines.

How it works

The node calls Python's str.join(). Give it a list ["a", "b", "c"] and a separator of ",", and you get "a,b,c". The default separator is $, which is a slightly odd choice - it's a carryover from the original LogicUtils code, where $ is used elsewhere as a list delimiter. You'll almost always change it to a comma, a pipe, or a space. It also passes scalars through untouched: if the input is already a single string (or int/float/bool), it returns it as-is rather than trying to iterate it.

Where it fits

  • Turning a multi-select or list output into a comma-separated string a prompt node or text encoder will accept.
  • Flattening a batch of tags or labels for display or for saving to a file.
  • Converting a combo selection into text you can feed JDCN_TXTFileSaver for a log line.

It's part of the pack's LogicUtil category - the LogicUtil_ prefix means the set is ported from aria1th's ComfyUI-LogicUtils. Its mirror node, LogicUtil_String List to Combo, goes the other direction (string → list), so together they let you bounce between the two shapes.

Install

Ships in ComfyUI-JDCN. ComfyUI Manager → Install Custom Nodes → search "JDCN", or:

cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-JDCN.git
pip install -r requirements.txt

Pack dependency is just piexif (plus psutil, already in ComfyUI). No models.

Gotchas

  • Change that $. The default separator is the one thing most people get bitten by - output like "a$b$c" when you expected commas. Set separator explicitly.
  • It won't stringify a list of lists - if the input is nested (a list of batches), join fails. Flatten with JDCN_ReBatch set to TextList, or check what's on the wire.
  • Scalar passthrough is silent - if a single string goes in, it comes out identical, which is usually what you want but can mask a type problem upstream.

Tiny node, predictable behavior, and the one knob that matters is spelled "separator."

CategoryLogicUtil

Inputs (2)

NameTypeDefaultDescription
combo*
separatorSTRING$

Outputs (1)

NameTypeDescription
STRINGSTRING