ComfyUI Node

Convert to

Turn anything into a string, int, float or boolean in a Cyclist loop

By Pos13·Created 2 years ago·Updated 2 years ago· 33
Convert to
  • anything
  • STRING
  • INT
  • FLOAT
  • BOOLEAN

Convert to takes a single input of any type and gives you four outputs at once: a string, an int, a float, and a boolean representation of it. It's the type-adapter of the Cyclist pack - the node you drop in when one node hands you a value in the wrong shape for the next node's input. In graph-based tools this kind of glue is unglamorous and constantly needed, and looping workflows need it more than most.

Why loops need a caster

When you're chaining nodes from different packs into a loop, types don't always line up. A scorer outputs a boolean but the next node only takes a number; a value comes through as a float but you want it as a string for a filename. Convert to bridges those. The pack's own "generate until good, keep the best" example uses exactly this: WAS Node Suite only works with the number form of a boolean, so Convert to casts boolean → float → number to make the pieces fit. Without a caster you'd be stuck, because ComfyUI won't let you wire a boolean into a float input directly.

The inputs and outputs

  • anything (*) - the single input. Wildcard, so it takes whatever you plug in.

Four outputs, all produced from that one input:

  • STRING - the text form.
  • INT - the integer form.
  • FLOAT - the decimal form.
  • BOOLEAN - the true/false form.

You just wire out whichever one you need; you don't have to use all four. Per the author, boolean and string can always be produced from any input, but int and float can fail: if the value doesn't sensibly represent a number, the int or float output raises an error. So casting "hello" to a string is fine and to a boolean is fine, but to an int will blow up.

Install

  • ComfyUI Manager: search comfyui-cyclist, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/Pos13/comfyui-cyclist, restart.

Pure Python - no downloads.

Watch out for

The one real trap: pull only the outputs you can safely produce. If you wire the INT or FLOAT output from something that isn't numeric, you get an error, not a silent null. If you only need the string or boolean, only connect those and you're safe. When you're not sure a value is numeric, it's the difference between a working loop and a crash mid-run.

Also handy to remember alongside Compare Anything: if a comparison is behaving strangely because two inputs are different types, running both through Convert to first - casting them explicitly to the same type - takes the guesswork out of what's being compared.

And, as with every node here: Cyclist is archived and unmaintained. Convert to is simple and should keep working, but there's nobody on the other end for fixes.

Categorycyclist/Utilities

Inputs (1)

NameTypeDefaultDescription
anything*

Outputs (4)

NameTypeDescription
STRINGSTRING
INTINT
FLOATFLOAT
BOOLEANBOOLEAN