Nodes/Mikey Nodes/Eval Floats (Mikey)
ComfyUI Node

Eval Floats (Mikey)

A formula box for two numbers, instead of a chain of math nodes

By bash-j·Created 3 years ago·Updated 10 months ago· 188
Eval Floats (Mikey)
    • result_float
    • result_int
    • result_str
    a0.00
    b0.00
    formulaa + b

    Most of the time you need a bit of math inside a ComfyUI graph, you reach for a stack of separate nodes - an Add here, a Multiply there, maybe a cast to INT at the end. EvalFloats collapses all of that into one box: two float inputs, a text field where you type the actual formula, and three outputs so whatever comes out the other end is already in the type your next node wants.

    It's a small node and the README barely mentions it (one line in the "additional nodes" list), but it's the kind of thing that quietly saves you from building a five-node math chain every time you need steps * 1.5 or (upscale_by - 1) / 2.

    How it works

    You wire in two numbers as a and b, then edit the formula field - it defaults to a + b, and you replace that with whatever expression you actually want, using a and b as your only two variables. The node evaluates the string and hands the result back in three forms at once: as a float, as an int, and as a string. That's the whole design - one calculation, three sockets, so you're never stuck adding a separate type-conversion node just because the thing downstream wants a STRING instead of a FLOAT.

    The inputs and outputs that matter

    • a and b (FLOAT, default 0) - your two operands. Nothing fancier than that; if you need a third value in the equation, either fold it into a or b upstream, or chain a second EvalFloats node off this one's output.
    • formula (STRING, default a + b) - the actual math. Basic arithmetic (+ - * /), grouping with parentheses, whatever your formula needs - this is the one field you'll actually touch on every use.
    • result_float, result_int, result_str - the same computed value in three types. Grab whichever one the next node in your graph expects instead of hunting for a converter.

    How to install it

    EvalFloats ships as part of the wider Mikey Nodes pack, so there's no separate install for it specifically. Easiest path is ComfyUI Manager - search "Mikey Nodes" and install. Manually, it's the standard pattern:

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

    then restart ComfyUI. The README's install section doesn't call out a requirements.txt step for the pack, and this node in particular needs nothing beyond what ComfyUI already ships with - no models, no extra downloads.

    Common issues & troubleshooting

    Only two variables. a and b are it - there's no c. If your calculation genuinely needs three or more inputs, you're either pre-combining two of them before this node or daisy-chaining a second EvalFloats off the first one's result.

    Left the formula on the default. If you forget to edit formula away from a + b, you'll silently get exactly that back - addition, not whatever you meant to compute. Worth a glance whenever a downstream value looks wrong; it's an easy field to skip past in the node's compact widget.

    result_int truncates, it doesn't round. If your formula produces something like 3.9 and you're pulling from result_int, expect 3, not 4. If you need proper rounding, build that into the formula itself rather than relying on the int output to do it for you.

    Treat the formula field like code, because it is. ComfyUI Manager's own README doesn't document exactly how this expression gets evaluated under the hood, unlike rgthree's Power Puter - a similar expression-evaluator node in a different pack - which explicitly documents parsing to an AST against an allowlist of safe built-ins. Mikey Nodes' README says nothing about that here. The practical takeaway isn't that this node is dangerous - it's that you shouldn't load a workflow JSON from someone you don't trust and queue it blind if it contains an EvalFloats node with a formula you haven't actually read.

    CategoryMikey/Math

    Inputs (3)

    NameTypeDefaultDescription
    aFLOAT0.00
    bFLOAT0.00
    formulaSTRINGa + b

    Outputs (3)

    NameTypeDescription
    result_floatFLOAT
    result_intINT
    result_strSTRING