ComfyUI Node

Log

Log (LogNode) — ComfyUI-LogicUtils

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Log
    • FLOAT
    input1
    base

    Log is the nichest node in a pack full of niche nodes, and that's fine, because when you need a logarithm you really need it and nothing else will do. It computes the log of one number to a base you specify. If you're doing any kind of curve shaping, mapping a linear slider onto a perceptual scale, or building a value schedule that isn't linear, this is the math you want.

    Be honest with yourself about whether you're in that situation, though. Most workflows never touch a logarithm. The people who reach for this are usually building something deliberate, a custom noise or strength ramp, a non-linear mapping between two parameters, an experiment that needs log-spaced values. If that's not you, the simpler math nodes in the same pack (Multiply, Divide, Add) cover the everyday cases and this one just sits in the menu.

    It comes from ComfyUI-LogicUtils, aria1th's utility pack. aria1th is AngelBottomless, the trainer behind Illustrious XL, and the pack is his personal toolkit, which explains both the breadth of oddball math nodes and the near-total absence of documentation. A node like Log is exactly the kind of thing a researcher throws in because they wanted it once.

    Inputs and outputs

    Two required inputs, both FLOAT. input1 is the number you're taking the log of, and base is the logarithm base. The single output is a FLOAT. So input1 = 8, base = 2 gives you 3, because 2 to the power 3 is 8. Want a natural log? Set the base to roughly 2.718. Want log base 10? Set base to 10.

    Unlike the arithmetic nodes in this pack, Log's inputs are typed FLOAT rather than the wildcard, so it expects actual numbers and won't pretend to accept anything else.

    Installing it

    • ComfyUI Manager: search "ComfyUI-LogicUtils" in Custom Nodes Manager, install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.

    No models, no dependencies of note. The pack's optional auto-installer is off unless you set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (disable with COMFYUI_LOGICUTILS_SKIP_INSTALL=1), and computing a logarithm needs none of it.

    The math gotchas

    Logarithms have domain rules and the node won't protect you from breaking them. input1 has to be greater than zero; the log of zero or a negative number isn't defined and the operation will fail. The base has to be positive and not equal to 1, because base 1 is meaningless for a logarithm. When these inputs are computed upstream rather than typed, that's exactly where a workflow throws a math error that looks like it's Log's fault when really some earlier node handed it a zero or a negative.

    So if Log errors, check the two values going into it before you check anything else. And if the output is a float you need to feed into an integer field, run it through Round on the way out. For everything else, this is a specialist tool: brilliant when you need it, invisible when you don't.

    CategoryMath

    Inputs (2)

    NameTypeDefaultDescription
    input1FLOAT
    baseFLOAT

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT