Math debug
Math Debug — the tiny node that shows you what's actually on the wire
- value
Math Debug doesn't make a single pixel of a picture. You use it when a picture came out wrong and you need to know why. ComfyUI is great at hiding what's traveling along a wire - you can chain a whole math branch together and have no idea whether the number reaching your crop node is 512 or 0.002. This node is the "print()" that un-hides it: you wire any value into it and it displays that value as text, right on the node, with a label you choose.
It ships inside cubiq's standalone Simple Math pack (repo ComfyUI_SimpleMath), the little two-node utility that pairs with Math op. Where Math op computes a / b and hands you an INT and a FLOAT, Math Debug is the sibling you bolt onto that output to actually see the result. If you've used a "Display Any" or ShowText node from another pack, you already know the pattern - this is that, minus the ceremony.
How it works
Simple Math's whole pack is this: compute a number, then look at the number. Math Debug is a terminal node - it takes exactly one input and has no outputs, so nothing wires out of the far side. It's marked as an output node in ComfyUI's eyes, which matters more than it sounds: ComfyUI guarantees output nodes (and everything feeding them) actually execute and won't prune the branch. So bolting one onto a calculation is also a way to force that calculation to run even when nothing downstream is consuming it - which, for debugging, is precisely the behavior you want. The node renders the string form of whatever arrives, stuck in front of your prefix label.
The inputs that matter
There are only two, and you'll set one of them:
- value (required, type
*wildcard) - the thing to inspect. Wire the INT or FLOAT output of Math op into this, or a seed, a string, whatever. The wildcard type means it accepts anything, which is the point of a debug node. - prefix (optional, default
"Value:") - the label shown in front of the value. Change it to"width:"or"batch count:"so when you have three debug nodes on screen you can tell which is which. This is genuinely the only field you'll ever touch.
That's it. No outputs, no settings. It's a sticky note with a number on it.
Installing it
The whole pack is one tiny repo with no dependencies and no model downloads, which is the entire appeal:
cd ComfyUI/custom_nodes
git clone https://github.com/cubiq/ComfyUI_SimpleMath
then restart ComfyUI. Via ComfyUI Manager, search Simple Math and install. You'll find "Math debug" under utils → Math op. The pack is old - it dates from 2023 and was last touched mid-2024 - but that's fine here, because there's almost nothing in it that can break.
Gotchas and traps
The big one is the name collision. cubiq - Matteo Spinelli, the author of the community-standard ComfyUI_IPAdapter_plus - also maintains the far larger ComfyUI Essentials pack, which has its own fancier 🔧 Simple Math (SimpleMath+) with a/b/c inputs and a Console Debug node. Those are a different repo. If a workflow you downloaded asks for SimpleMath+, it wants Essentials, not this pack - the two get mixed up constantly. If you're already running Essentials, you don't need this standalone pack at all; this one is for minimal installs that want arithmetic and a display node with zero baggage.
A couple of practical notes: it's a terminal, so don't expect it to pass data through - attach it to the side of a branch or the end of a chain. And nothing displays until you actually run the graph, so if the node looks empty that's normal until you hit queue. One real-world quirk of this pack worth knowing: the sibling Math op node's a and b inputs are typed as INT,FLOAT, and people wiring plain integers into them have hit Return type mismatch: INT != INT,FLOAT validation errors mid-2024 (a thread in r/comfyui had exactly that, with a commenter reaching for a display node to see what was on the wire). If you see that, Math Debug is the honest way to check what's actually arriving before you blame the math.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| value | * | — | |
| prefixopt | STRING | Value: | — |
Outputs (0)
No outputs