Nodes/Bjornulf_custom_nodes/โœจโžœ๐Ÿ”ข Anything to Float
ComfyUI Node

โœจโžœ๐Ÿ”ข Anything to Float

Force a strict FLOAT socket to accept whatever you've got

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
โœจโžœ๐Ÿ”ข Anything to Float
  • anything
  • float

ComfyUI's type system is strict about sockets - a widget that wants a FLOAT won't take a wildcard * output, even if the value flowing through is numerically fine. That mismatch shows up constantly once you start using Bjornulf's more flexible nodes, several of which output wildcard types by design (list loopers, variable nodes, anything-to-anything converters). This node is the fix: it takes literally anything and forces it into a real FLOAT, so it'll plug into any input that insists on one - cfg, denoise, and similar numeric widgets.

How it works

There's exactly one input, typed as a wildcard (*), so ComfyUI won't complain no matter what you connect - a string, an int, a wildcard from another Bjornulf node. The node converts whatever arrives into a FLOAT and outputs that. It's a small adapter, not a math node: it doesn't round, clamp, or validate a range, it just changes the type so a strict socket will accept the value.

The practical trigger for needing this is almost always the same shape: you've got a value coming from a loop, a random node, or a text-parsing chain, and the specific input you want to feed - a KSampler's cfg, a scheduler's denoise - refuses the wildcard type your source node happens to output. Drop this in between and the type mismatch disappears.

The inputs and outputs that matter

  • anything (required, wildcard *) - connect whatever you've got; the node doesn't restrict what's coming in.
  • Output float (FLOAT) - the converted value, ready for any strict FLOAT input.

Nothing else to configure. If the conversion doesn't produce a sensible number - say, the input was genuinely non-numeric text - that's a signal your upstream value wasn't what you expected, not something this node can fix for you.

How to install it

ComfyUI Manager โ†’ search Bjornulf_custom_nodes โ†’ install โ†’ restart. Manual:

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

Zero special dependency - this is a type conversion utility, not something that touches models or external services. It loads regardless of what else in the pack you've set up.

Common issues & troubleshooting

The downstream node still rejects the value. Confirm the output of this node - float - is actually what's wired in, not the original wildcard input left connected somewhere alongside it. It's easy to add this converter to a graph and forget to reroute the existing wire through it.

I got an unexpected number, like 0.0, instead of an error. This node converts rather than validates - if the incoming value can't be meaningfully turned into a float (non-numeric text, for instance), you may get a fallback or garbage value rather than a clear failure. Trace the value one step upstream with a Show node before assuming this converter is the problem.

Do I need this if my node already outputs FLOAT? No - this exists specifically for the mismatch between wildcard-typed nodes and strict-typed inputs. If your source node already outputs a proper FLOAT, wiring straight through works fine and this node is redundant.

Which one do I use - this, Anything to Int, or Anything to Text? Match it to whatever the target input actually wants. If a KSampler input wants a whole number (steps, batch size), use Anything to Int instead; this one is specifically for FLOAT-typed sockets like cfg or denoise.

CategoryBjornulf

Inputs (1)

NameTypeDefaultDescription
anything*โ€”

Outputs (1)

NameTypeDescription
floatFLOATโ€”