Shima Float (Math)
A float primitive that doubles as a little math calculator
- a
- b
- c
- value
At its core this is just a float primitive - a node that holds a number so you can fan the same value out to several inputs, the ComfyUI staple of "one source, many consumers." But Shima.Float adds a genuinely handy twist: an expression field. Set it to something like a * 1.5 and the node becomes a one-line calculator that runs on its inputs and hands you the result as a FLOAT.
Why would a beginner care? Because half the time you want "that number, but scaled" - half the denoise, double the steps, CFG times a Lora weight - and normally you'd reach for a dedicated math node or type the arithmetic in your head. With this one you type the formula into the widget and it just works.
The mechanics are simple and safe. You give it value (FLOAT, default 1) and expression (STRING, default a), plus up to three optional numeric inputs a, b, c (accepting INT or FLOAT). When the expression is the default a and a is left unconnected, it returns value unchanged - so out of the box it behaves like a plain float primitive. If you write a real expression, it's evaluated against a small context of a, b, c, and value using safe_eval, which parses it as an AST rather than executing arbitrary Python. No os.system sneaking into your formula - it's arithmetic, not scripting, and that's a good thing.
The one input you'll actually edit is expression; a/b/c only matter when you wire something in. And as with everything in this pack, allow_external_linking controls whether the node broadcasts outside its island group via Use Everywhere - off unless you mean it.
Output: a single FLOAT named value, ready to feed denoise strength, a scaled CFG, a batch count, anything.
There's a Shima.Int sibling with the same expression feature for integer results, so pick the type you need rather than casting. One small gotcha: because the default expression is a, if you do connect something to a expecting value to win, it won't - a takes over and value is ignored. Keep the expression honest with what you wired.
Install the pack via ComfyUI Manager (search "Shima") or
cd ComfyUI/custom_nodes
git clone https://github.com/KDB-USJP/shima_wf
then restart. No models, no dependencies beyond the pack itself.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT | 1.00 | — |
| expression | STRING | a | — |
| aopt | INT,FLOAT | 0 | — |
| bopt | INT,FLOAT | 0 | — |
| copt | INT,FLOAT | 0 | — |
| allow_external_linkingopt | BOOLEAN | false | If ON, this node broadcasts/receives OUTSIDE the Island (ignores group regex) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | FLOAT | — |