Nodes/Mikey Nodes/Float to String (Mikey)
ComfyUI Node

Float to String (Mikey)

Turn a numeric widget into text you can save or stamp

By bash-j·Created 3 years ago·Updated 10 months ago· 188
Float to String (Mikey)
    • STRING
    float_0.00
    use_commasfalse

    A small but genuinely handy plumbing node. ComfyUI is fussy about types - a lot of nodes that build filenames or metadata want a STRING, and a lot of the values you actually care about recording (a CFG scale, a denoise strength, an upscale factor) live as FLOAT widgets somewhere else in your graph. Float to String is the bridge: feed it a float, get back text you can actually use in a filename prefix, a metadata value, or a concatenated summary string.

    There's nothing mysterious about the mechanism - it converts the number to its text representation, with one formatting choice: use_commas, which adds thousands separators for larger numbers (so 12000 becomes 12,000 rather than a plain run of digits). That's mostly relevant if you're formatting something like a pixel count or a large seed-adjacent number for readability; for typical sampler values like CFG or denoise you probably won't notice a difference either way.

    The inputs that matter: float_ is the number itself (0 to 1,000,000, default 0) - usually you'll convert this to an input and wire it from wherever the real value lives upstream (a CFG widget, a denoise strength, whatever you're trying to record) rather than typing a static number here. use_commas is the true/false formatting toggle described above. The output is a single STRING.

    The natural pairing is with Add Metadata or Text Concat - convert a numeric setting to a string here, then either stamp it directly onto an image with Add Metadata, or fold it into a larger compound string with Text Concat before it goes anywhere. It's a one-job utility node, and its whole value is unblocking exactly that kind of chain.

    Installing it

    Comes with the full Mikey Nodes pack. Through ComfyUI Manager, search "Mikey Nodes." Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bash-j/mikey_nodes
    

    Restart ComfyUI. No models or dependencies needed - it's a plain type-conversion utility.

    Common issues

    There's not much to go wrong mechanically, but one thing worth knowing: the node doesn't expose a decimal-precision or rounding control in its inputs, so you're working with whatever default float-to-text formatting Python produces - if you're recording a value like a denoise strength and it comes out with more decimal places than you'd like in a filename or label, that's a formatting quirk to expect rather than a setting you can tune away here. If precision control genuinely matters for your use case, you may need to round the value upstream before it reaches this node.

    If you're looking to convert a whole number instead of a float, this isn't the node - the pack ships a separate "Int to String" node for that; using Float to String on an already-integer value will still work, but you'll want the dedicated int version if you're specifically dealing with whole numbers like a seed or batch count.

    CategoryMikey/Utils

    Inputs (2)

    NameTypeDefaultDescription
    float_FLOAT0.000–1000000
    use_commasCOMBOfalse2 options: true, false

    Outputs (1)

    NameTypeDescription
    STRINGSTRING