Nodes/ComfyUI Easy Use/easy convertAnything
ComfyUI Node Runs on cloud

easy convertAnything

Coerce a value into another type

By yolain·Created 3 years ago·Updated 9 days ago· 2,635
easy convertAnything
  • *
  • output
output_typestring

ComfyUI is fussy about types. A node that wants a string won't take an integer; a float and an int are different wires even when they're both "5." That's usually fine, until you're gluing two nodes together that disagree about the type of the same value - and then you need a little adapter. easy convertAnything is that adapter: feed it a value, pick the output type, and it hands back the same value converted. Int to string, string to float, whatever the two ends need to agree on.

It's plumbing, plain and simple, but it's the kind of plumbing that unblocks a workflow in one node instead of sending you hunting for a type-specific converter. Building a filename out of a number? Convert the int to a string. Got a text value that needs to be a number for some math? Convert it. This is the node.

How it works

It reads your input value and casts it to the output_type you select - string, int, float, boolean, and so on. The conversion follows the obvious rules (the number 5 becomes the text "5", the text "5" becomes the number 5, and so forth). Both the input and output are the ComfyUI wildcard type (*), so it accepts anything and the chosen output_type determines what comes out.

The inputs and outputs that matter

  • * (wildcard) - the value to convert.
  • output_type - the type you want out (string, int, float, boolean, …).
  • output (wildcard) - the converted value, wire it into whatever needed the new type.

That's the whole node. This one is also flagged as an output node, so it can show the converted result in the UI as well as pass it along - handy for a quick "what does this value look like as a string?" check.

How to install it

Part of ComfyUI-Easy-Use. ComfyUI Manager: search ComfyUI-Easy-Use, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use

then install.bat (Windows) or pip install -r ComfyUI-Easy-Use/requirements.txt, and restart. No models.

Common issues & troubleshooting

A conversion that doesn't make sense fails. Not everything converts cleanly. Casting the text "hello" to an int has no sensible answer, and you'll get an error rather than a silent zero. Only convert between types where the value actually has a meaningful representation in the target.

Float-to-int drops the decimal. Converting 3.7 to an int gives you 3, not 4 - it truncates rather than rounds (this is the usual behavior). If you needed rounding, do the math before converting.

Still a type error downstream. Double-check you picked the type the consuming node actually wants. It's easy to convert to float when the next node wanted int, and the mismatch just moves one node down. Look at what the destination input expects and set output_type to match it exactly.

Don't reach for it reflexively. If two nodes already agree on type, you don't need this in between - it's an adapter for genuine mismatches, not something every wire should route through.

CategoryEasyUse/Logic

Inputs (2)

NameTypeDefaultDescription
**
output_typeCOMBOstring4 options: string, int, float, boolean

Outputs (1)

NameTypeDescription
output*