ComfyUI Node Runs on cloud

Random

DF_Random – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Random
    • FLOAT
    Value_A0.00
    Value_B1.00
    seed0

    DF_Random gives you a random float somewhere between two bounds you set - "random value within threshold," as the pack's own README puts it. It's part of Derfuu_ComfyUI_ModdedNodes, a math-and-utility pack that's been part of ComfyUI since 2023, and this particular node fills a gap that's still genuinely awkward to solve with core ComfyUI alone: getting a number - not a seed, not an image, an actual usable float - to vary randomly between runs, driven by the same kind of seed mechanism you already use for sampling.

    You'd reach for this anywhere you want controlled randomness inside your graph's own math rather than in the diffusion process itself: randomizing a scale factor slightly on every run so a batch doesn't come out identically sized, jittering a conditioning area's offset, or feeding a random float into some other custom math chain built from this pack's other nodes.

    Inputs and output

    Three required inputs:

    • Value_A - the low end of the range (defaults to 0)
    • Value_B - the high end of the range (defaults to 1)
    • seed - an INT from 0 up to 4294967295

    One output: FLOAT, a random value between Value_A and Value_B.

    The seed behaves the way you'd expect from anywhere else in ComfyUI that uses one: the same seed produces the same "random" value every time. That's the useful part - if you want a workflow to be reproducible run to run despite having a randomized step in it, pin the seed to a fixed number instead of leaving it on ComfyUI's randomize-every-queue behavior. If you actually want a different value each run, treat this seed widget the same way you'd treat a KSampler's seed and randomize it between queues.

    Where it fits

    This is a small building block for workflows that want controlled variation in something other than the image itself - a scale factor, an offset, a parameter fed into another math node. It's not a replacement for a proper seed-driven sampler; it's for randomizing your own custom graph logic. If your workflow doesn't do any custom math beyond the standard txt2img/img2img path, you're unlikely to need this at all.

    Installing

    The whole pack installs together - there's no way to grab a single node from it. Through ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart ComfyUI. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
    

    then restart. No models, no unusual dependencies - pure Python logic, install is fast.

    Troubleshooting

    If DF_Random doesn't show up in the node menu right after installing, restart the server and hard-refresh your browser tab - that resolves the large majority of "installed but not visible" reports and is a generic ComfyUI frontend quirk, not something specific to this pack.

    One thing to double-check if the node seems to be giving you the "same" random value across queues when you expected variation: confirm the seed widget's control mode is actually set to randomize rather than fixed - it's easy to leave a widget like this pinned after testing and forget it's locked.

    Worth knowing about the pack in general: its maintainer has, in the past, removed deprecated nodes outright on updates rather than keeping a legacy-labeled copy around, which has broken workflows for people who relied on the pack over the long term. This node has been a stable fixture and isn't among the ones historically pruned, but if an old workflow throws a missing-node error elsewhere after an update, that maintenance history is worth checking first.

    CategoryDerfuu_Nodes/Functions

    Inputs (3)

    NameTypeDefaultDescription
    Value_AFLOAT0.00
    Value_BFLOAT1.00
    seedINT00–4294967295

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT