Nodes/ComfyUI-LogicUtils/System Random Float
ComfyUI Node

System Random Float

System Random Float (SystemRandomFloat) — ComfyUI-LogicUtils

By aria1th·Created 3 years ago·Updated 7 months ago· 116
System Random Float
    • FLOAT
    min_val0.00
    max_val1.00
    precision0

    SystemRandomFloat hands you a random decimal number, fresh on every run, with no seed to pin it. It's the floating-point cousin of SystemRandomInt in the same pack, and you reach for it when you want to jitter something continuous, a denoise strength, a CFG value, a blend weight, and you're fine with it being different each time you queue.

    The "no seed" part is the whole personality. There's no way to reproduce a given draw, so this is for when you genuinely want variety rather than repeatability. That's a narrower use case than it first appears, because most of the time in generation work you want to be able to get a good result back, and for that you'd want a seeded random instead. But for "give me a new random strength every run and I don't care about recreating it," this is the tool.

    It comes from ComfyUI-LogicUtils, aria1th's utility pack. aria1th is AngelBottomless, the trainer behind Illustrious XL, and the pack is his personal toolkit, so the nodes are terse and the documentation is essentially the source code.

    Inputs and outputs

    Three required inputs. min_val and max_val are FLOATs that set the range, defaulting to 0 and 1. precision is an INT from 0 to 10 that controls how many decimal places the result is rounded to. The single output is a FLOAT. Like the other system-random nodes, it's an output node, so it runs on queue regardless of what's downstream.

    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 heavy dependencies. The pack's optional auto-installer only runs if you set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (turn it off with COMFYUI_LOGICUTILS_SKIP_INSTALL=1), and a random float needs none of it.

    The precision trap

    This is the one that'll get you. The precision input defaults to 0, and precision 0 means "round to zero decimal places," which is to say round to a whole number. So with the default range of 0 to 1 and the default precision, this node will hand you 0 or 1 and basically nothing in between. If you were expecting a smooth fractional value like 0.37 and you're getting flat integers, that's why. Bump precision up to 2 or 3 and you'll get the decimals you actually wanted.

    The other caveat is the same as every unseeded random: because there's no seed, the value changes every run and can't be reproduced, and everything downstream inherits that unrepeatability. If you later want to recreate a run, you can't. When that matters, you want a seeded random node instead. When you specifically want fresh entropy each time, set the range and the precision deliberately and this does the job.

    CategoryLogic Gates

    Inputs (3)

    NameTypeDefaultDescription
    min_valFLOAT0.00-999999999–999999999
    max_valFLOAT1.00-999999999–999999999
    precisionINT00–10

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT