Eden_Math
A safe-eval calculator with variables a, b, c — and it hands you the answer three ways
- a
- b
- c
- result (float)
- result (int)
- result (float_str)
Eden_Math is the little calculator node you'll wire in when you need a value that's derived, not typed. You type an expression string like a * 2 + b, feed a and b from other nodes, and it evaluates. No model, no GPU, no latency - pure number crunching in your graph.
How it works
The expression is evaluated with variables a, b, and c (all optional, defaulting to 0). You write the formula in the expression string; anything that's a basic arithmetic expression or common function works. The outputs are the genuinely useful part: it returns the result three ways - result (float), result (int), and result (float_str) (the float as a string). So you wire whichever type your downstream consumer demands without needing a separate conversion node. Need an int for a step count? Take the int output. Need to jam a number into a text node? Take the string.
Inputs
- expression (
STRING) - the formula. This is the whole point of the node. - a / b / c - optional numeric inputs, used as variables in the expression.
Outputs: result (float), result (int), result (float_str).
What to do with it
Dynamic sizing is the killer app. Take a seed-driven random number from Eden_RandomNumberSampler, feed it through a scaling expression, and use the int output to drive a resolution or a latent dimension. Or compute a denoise strength from a batch index, or a weight from a slider. It's the general-purpose alternative to a whole shelf of single-purpose math nodes - if you've got a formula, this beats chaining three adders and a multiplier.
Installing it
Ships in the Eden.art nodesuite (edenartlab/eden_comfy_pipelines). Install via ComfyUI Manager (search "Eden.art nodesuite") or:
cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/eden_comfy_pipelines
cd eden_comfy_pipelines && pip install -r requirements.txt
Restart ComfyUI. As with the whole pack, the requirements list is heavy (clip-interrogator, transformers, opencv-python, …), so expect a chunkier install than the node's footprint suggests.
Common issues
Empty or malformed expressions just return the defaults - blank expression with no inputs gives you 0, which is easy to misread as "broken." Check you used a, b, c exactly (lowercase). And remember the int output is the truncated result of the math, not a rounded one - if your formula gives 3.9, the int output is 3. When precision at the boundary matters, do the rounding inside the expression (round(a * b) if that function's available) rather than trusting the int output to round for you.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| expression | STRING | — | |
| aopt | * | 0 | — |
| bopt | * | 0 | — |
| copt | * | 0 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| result (float) | FLOAT | — |
| result (int) | INT | — |
| result (float_str) | STRING | — |