Nodes/ComfyUI-outputlists-combiner/Convert To Int Float Str
ComfyUI Node

Convert To Int Float Str

One node to turn '1;2;3', 42.5, or a string full of numbers into usable int/float lists

By geroldmeisinger·Created 9 months ago·Updated 2 days ago· 184
Convert To Int Float Str
  • number
  • int
  • float
  • string
  • count

ComfyUI is picky about types. A string that happens to contain a number is still a string, an int won't always plug into a FLOAT socket, and half the utility nodes in the ecosystem exist just to fight this war. Convert To Int Float Str is a small, gloriously permissive node that takes anything number-like and hands you int, float, and string versions of every number it can find inside.

The trick is what it uses under the hood: nums_from_string.get_nums, which is aggressively permissive. It handles actual ints, actual floats, floats as strings, and strings that contain several numbers mixed in with text. Feed it "width: 512 height: 768" and it finds both. That permissiveness is the whole personality of this node - it's the "just make it work" node for numbers.

The input and outputs

One input, labeled any (it's a wildcard, so anything connects). Three outputs, each an output list, plus count:

  • int - every number found, decimals truncated (i.e. 42.7 becomes 42).
  • float - every number as a float.
  • string - every number formatted as a string.
  • count - how many numbers were found.

Because the outputs are output lists, the downstream node runs once per number. That's the feature: type "256;512;768" into a box, and three size variants run in one queue.

The separator gotcha

The README is blunt about this: use ; to make a list - "123;234;345" - and don't use commas. The parser is so permissive that commas get interpreted as thousand-separators. "1,234" isn't two numbers, it's one number (1234). If you habitually reach for comma-separated lists, this is the one habit to break here.

It's also a neat bridge node: if some other custom node hands you a single number buried in a string (a width read from an image, an API response field), this converts it to the type the next node insists on. For clean, deliberate ranges, Number OutputList or JSON OutputList are better tools - reach for this one when the input is messy and you just want the numbers out.

Installing

Search "OutputLists Combiner" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/geroldmeisinger/ComfyUI-outputlists-combiner
cd ComfyUI-outputlists-combiner
uv pip install -r requirements.txt

Restart afterward. No model downloads; the pack's shared dependencies (pandas, skia-python) install on first use.

CategoryUtility

Inputs (1)

NameTypeDefaultDescription
number*Anything that can be meaningfully converted to a string with parseable numbers inside

Outputs (4)

NameTypeDescription
intINTAll the numbers found in the string with the decimals truncated. use(s) `is_output_list=True` (indicated by the symbol `𝌠`) and will be processed sequentially by corresponding nodes.
floatFLOATAll the numbers found in the string as floats. use(s) `is_output_list=True` (indicated by the symbol `𝌠`) and will be processed sequentially by corresponding nodes.
stringSTRINGAll the numbers found in the string as floats converted to string. use(s) `is_output_list=True` (indicated by the symbol `𝌠`) and will be processed sequentially by corresponding nodes.
countINTAmount of numbers found in the value.