Nodes/Octo Json Presets/Anything into string
ComfyUI Node

Anything into string

The boring type adapter that un-sticks half of ComfyUI's dropdowns

By writer-in-fancy-pants·Created 12 months ago·Updated 12 months ago· 0
Anything into string
  • combo_input
  • text_output

ComfyUI is a graph made of strongly typed wires, and one of the first things that bites you is a value arriving in the wrong type. A combo dropdown hands you a string, but upstream a node spat out an INT, or worse, a list. The downstream text field just stares at you. That's the whole reason "Anything into string" exists: it wraps whatever you feed it in Python's str() and hands back plain text. No API calls, no keys, no settings. Five lines of code, and for a chunk of workflows, exactly what's missing.

You'll reach for it in two situations. First, when a node outputs a number or a list and you want to pipe it into a text widget, a prompt builder, or a filename string. Second, when you're debugging and just want to see what a value actually is - route it here, wire text_output into a show-text style node, and the repr is right in front of you. It's the digital version of turning a thing over to read the label.

How it works

The class is literally called Anything into string - spaces and all, which ComfyUI tolerates even though most nodes use CamelCase. It declares one required input, combo_input, typed as * (the "any type" wildcard that accepts whatever lands on the wire), and does str(combo_input) on it. That's the entire mechanism. The output is text_output, a STRING, which plugs into any text input.

One honest caveat, because the name overpromises slightly: str() of a list gives you "['a', 'b']" - the Python repr, with brackets and quotes - not "a, b". For a single value it's perfect. For a list you'll be trimming brackets off the result, which is annoying enough that you'd probably rather fix the list upstream. And if the thing you feed it is already a string, it's a no-op, so don't build your workflow around pretending otherwise.

Installing it

This node ships in a small pack called Octo Json Presets. Easiest route is ComfyUI Manager: hit the Manager, search "Octo Json Presets", and install. Manual install is the usual dance:

cd ComfyUI/custom_nodes
git clone https://github.com/writer-in-fancy-pants/octo_json_presets

Then restart ComfyUI. The pack has no Python dependencies of its own and downloads no models, so there's nothing else to babysit - it'll show up under a utilities category in the node menu.

Common issues

There isn't much to go wrong with a str() wrapper, but two things trip people up. The first is the list-repr gotcha above - know what type you're feeding it. The second is expecting this to parse or clean text; it doesn't, it just converts. If you're feeding a numeric output to a KSampler step count, cast it to INT on the wire instead. And worth knowing before you build anything serious on this pack: it's a young, single-commit project (September 2025), so treat it as a handy utility, not a maintained dependency.

Categoryutilities

Inputs (1)

NameTypeDefaultDescription
combo_input*

Outputs (1)

NameTypeDescription
text_outputSTRING