Divide
Divide (DivideNode) — ComfyUI-LogicUtils
- input1
- input2
- FLOAT
Divide does the obvious thing: takes two numbers, divides the first by the second, gives you the result. You reach for it whenever a value in your graph needs to be a fraction of another one. Halve a resolution. Split a step budget across passes. Turn a raw pixel count into a ratio. Anywhere you'd otherwise pull out a calculator and paste a number by hand, you can wire the division into the graph instead and let it recompute itself when the inputs change.
That "recompute itself" part is the real argument for math nodes generally. Core ComfyUI has no arithmetic, so without a pack like this every derived number is a hardcoded constant you have to remember to update in three places. Wire the math and it stays correct on its own.
Divide ships in ComfyUI-LogicUtils, aria1th's logic-and-math utility pack. aria1th is the handle behind AngelBottomless, the trainer who built Illustrious XL, and this is his personal toolbox rather than a polished release, so the nodes are terse and the docs are thin on the ground.
Inputs and outputs
Two required inputs, input1 and input2, both typed * (the wildcard, so they accept numbers of any kind). input1 is the numerator, input2 the divisor. The single output is a FLOAT, and that's worth flagging: Divide always gives you a float, even when the division comes out even. 10 divided by 2 is 2.0, not 2.
Because of that, if the result is heading into an integer-only field like a step count or a dimension, put a Round after it to convert back to a clean INT. Divide then Round is a common little two-node pattern.
Installing it
- ComfyUI Manager: Custom Nodes Manager, search "ComfyUI-LogicUtils," install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.
No models, no heavy dependencies. The pack's optional dependency auto-installer only fires if you set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (force it off with COMFYUI_LOGICUTILS_SKIP_INSTALL=1), and dividing two numbers needs nothing extra.
The one real trap
Division by zero. If input2 ends up at 0, whether you typed it or it came from an upstream node that happened to output zero, the operation blows up or produces an infinity, and the failure can be confusing because it points at Divide when the actual problem is a value further back in the graph. If a workflow that uses Divide throws a math error, the first thing to check is whether the divisor could be zero. When the divisor is computed rather than fixed, it's worth guarding it, for example by running it through a Max against a tiny minimum so it can never actually reach zero.
Past that, Divide is exactly as simple as it looks. Two in, one float out, and the only thing that ever really goes wrong is the classic one everybody learns in school.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input1 | * | — | |
| input2 | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |