Nodes/ComfyUI-JDCN/LogicUtil_Random Shuffle Float
ComfyUI Node

LogicUtil_Random Shuffle Float

Shuffle a list of floats — seeded, so you can repeat it

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Random Shuffle Float
    • STRING
    input_string1.0$2.0$3.0
    separator$
    seed0

    Want a menu of strengths handed out in a different order every run, but still repeatably? LogicUtil_Random Shuffle Float splits a list, shuffles it with a seeded RNG, and hands back the reordered result. It's the shuffle member of the family, and the seed is what makes it actually usable: change the seed, get a new order; keep the seed, get the same order every time.

    How it works

    Three inputs: input_string (your list as one line, default 1.0$2.0$3.0), separator (default $), and seed (an INT from 0 to 9999999999, default 0). The node splits on the separator, runs the pieces through random.Random(seed).shuffle(), and outputs the shuffled result.

    Now the two things that will trip you up. First, despite the "Float" in the name, nothing is cast to float. The pieces are shuffled as strings and come out as strings. 1.0$2.0$3.0 shuffled might come back as ["2.0", "1.0", "3.0"] - text, not numbers. The Int and String variants behave identically; the name is aspirational. Second, the output is a list, not a single string - the schema declares STRING, but what actually flows out is the shuffled list, which is how the LogicUtil family threads lists between nodes. Feed it to a list-aware consumer, not to a field that wants one value.

    Where it earns its keep: randomized-but-reproducible ordering. Shuffle a list of prompt styles so each queue run gets a fresh order, but keep the seed fixed when you're debugging so you can reproduce the exact run - the community's "change one variable at a time with a fixed seed" rule applies to ordering too. It also pairs naturally with the Manual Choice nodes: shuffle the list, then index into the shuffled order for "random without repetition" style behavior.

    It's part of the LogicUtil family - a port of aria1th's ComfyUI-LogicUtils riding inside the JDCN pack from Daxton Caylor and Jerry Davos, whose README documents the file and latent batch nodes and never mentions this family. When the graph shows LogicUtil_Random Shuffle Float, that's the original class name with the pack 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. And if your "shuffled floats" come out as strings and a downstream node complains, that's not a bug - cast them with a conversion node, or reach for the Int/Float choice nodes instead.

    CategoryLogicUtil

    Inputs (3)

    NameTypeDefaultDescription
    input_stringSTRING1.0$2.0$3.0
    separatorSTRING$
    seedINT00–9999999999

    Outputs (1)

    NameTypeDescription
    STRINGSTRING