Nodes/ComfyUI-JDCN/LogicUtil_Multiply
ComfyUI Node

LogicUtil_Multiply

Scale any number, two inputs in one out

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Multiply
  • input1
  • input2
  • *

ComfyUI ships math nodes for multiply, but they're usually locked to one type or buried inside a suite you installed for something else. LogicUtil_Multiply is the bare, untyped version: input1 times input2, and the output comes out whatever type the inputs were. That sounds trivial until you realize how much of workflow tuning is just "take that number and scale it."

How it works

The inputs are both typed *, so you can multiply two ints, two floats, or even string-typed numeric values in a pinch. The output keeps the same type - int times int is an int, and the moment either side is a float, you get a float. That type propagation matters: if you scale an INT by 0.5, you don't get 2.5, you get a float 2.5, which some downstream widgets will refuse. Cast it if the receiver is picky.

The classic uses are the ones that save you from rebuilding formulas:

  • Batch scaling. Multiply your batch size by a per-item count to compute total steps, or multiply a per-frame value by frame count for animation timing.
  • Strength scaling. Hang a Multiply between a KSampler's denoise and a configurable coefficient, and you get a "denoise multiplier" that stays within sane bounds when you combine it with Min/Max clamps.
  • Units conversion. Frames to seconds, pixels to megapixels - a Multiply and the right constant is often all it takes.

Type gotchas are the real failure mode here, not the math. Feed it a genuine string like "cat" and Python's * does string repetition - "cat" * 3 is "catcatcat" - which is almost certainly not what you wanted and produces a type you didn't expect downstream. The * input wildcard won't stop you, so keep the inputs numeric unless you know exactly why you're multiplying strings.

Multiply is part of the LogicUtil family, a port of aria1th's ComfyUI-LogicUtils riding inside the JDCN pack - the utility grab-bag from Daxton Caylor and Jerry Davos that's mostly known for its file and latent batch nodes. The README never documents this family, so when you see LogicUtil_Multiply in the graph, that's the original class name with the pack's prefix.

Install

Install is the standard JDCN routine: ComfyUI Manager → "Install Custom Node" → search JDCN → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-JDCN
cd ComfyUI-JDCN && pip install -r requirements.txt

Only piexif on the requirements list, no models to fetch. When a scaled value comes out looking like a repeated word, you fed it a string - the node did exactly what Python told it to.

CategoryLogicUtil

Inputs (2)

NameTypeDefaultDescription
input1*
input2*

Outputs (1)

NameTypeDescription
**