Nodes/ComfyUI-LogicUtils/Triangular Random Float
ComfyUI Node

Triangular Random Float

Random, but weighted toward a target

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Triangular Random Float
    • FLOAT
    low0.00
    high1.00
    mode0.50
    seed0

    A plain "random float between low and high" gives every value in that range equal odds. This node doesn't - it draws from a triangular distribution, which means you also pick a mode: the value the output is most likely to land near, with probability tapering off the further you get from it toward either edge. It's the difference between "randomize this parameter uniformly" and "usually stay close to X, but occasionally wander further" - a much more natural shape for most randomized-parameter use cases.

    It's one of the "Logic Gates" nodes in aria1th's ComfyUI-LogicUtils, a small pack of logic, random, and data-utility nodes. The same GitHub account trained the Illustrious XL checkpoints under the AngelBottomless handle - unrelated project, and one that's been quiet since a last push here on 2026-01-21, shortly before the author moved on to a full wildcards pack and then off image-generation work entirely.

    Inputs and outputs

    • low / high - the bounds of the range. Defaults 0 and 1.
    • mode - where the probability peaks. Default 0.5, the midpoint. The low/high/mode shape matches Python's own random.triangular() almost exactly, and that function's documented behavior is worth knowing here: if mode falls outside lowhigh, it gets clamped into range rather than erroring - so setting it out of bounds won't crash, it'll just squash the distribution's shape in a way you probably didn't intend. Keep mode between low and high to get the peak you're actually asking for.
    • seed - an integer, defaults to 0. This is what makes the draw reproducible: same seed, same low/high/mode, same output every time.
    • Output - a single FLOAT.

    Because the field is literally named seed, ComfyUI's frontend automatically adds the familiar randomize/increment/fixed control under the widget - the same one you're used to on a KSampler. Set it to randomize and you get a fresh draw every queue without wiring anything extra.

    Where you'd actually use it

    Anywhere you want randomized variation that still mostly hugs a target value - jittering a strength or weight parameter around a value you know works, without the wide swings a flat uniform range would give you. The seed also makes it the reproducible counterpart to this pack's other random node, System Random Gaussian Float, which deliberately has no seed and can never be locked to a repeatable value. If you need "same randomness every time I use this seed," this is the one; if you want genuinely unrepeatable jitter, that's the other.

    Installing it

    ComfyUI Manager → search ComfyUI-LogicUtils → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aria1th/ComfyUI-LogicUtils
    

    No models, and reportedly no real dependencies - a r/StableDiffusion thread recommending lean logic packs over WAS Node Suite and Impact Pack pointed at this exact pack for having none. The README's own auto-install hook is opt-in (COMFYUI_LOGICUTILS_AUTO_INSTALL=1, force-off with COMFYUI_LOGICUTILS_SKIP_INSTALL=1).

    Common issues

    The main trap is mode outside the lowhigh range, covered above - it won't error, it'll just quietly clamp and give you a distribution that doesn't peak where you expected. Beyond that, remember the seed only reproduces the result for the exact same low/high/mode/seed combination - change any of the four and you get a different draw even with the seed held fixed. And like the rest of this pack, it hasn't shipped an update since January 2026, so it's stable but not actively maintained.

    CategoryLogic Gates

    Inputs (4)

    NameTypeDefaultDescription
    lowFLOAT0.00-999999999–999999999
    highFLOAT1.00-999999999–999999999
    modeFLOAT0.50-999999999–999999999
    seedINT00–9223372036854776000

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT