Nodes/ComfyUI-JDCN/LogicUtil_Random Shuffle Int
ComfyUI Node

LogicUtil_Random Shuffle Int

Randomize an int list with a seed you control

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Random Shuffle Int
    • STRING
    input_string1$2$3
    separator$
    seed0

    LogicUtil_Random Shuffle Int scrambles a list of integers with a seeded random number generator, so you can get a different order every run or the exact same order every run, on command. It's the int-flavored member of the shuffle trio - and like its siblings, it has a naming caveat you should read before you trust it.

    How it works

    Inputs are the family standard: input_string (default 1$2$3), separator (default $), and seed (an INT, 0 to 9999999999, default 0). The node splits the string on the separator and shuffles the pieces with random.Random(seed).shuffle().

    The caveat: it does not cast to int. The name says "Int," but the elements are split as strings and shuffled as strings - 1$2$3 comes back as something like ["2", "1", "3"], text pieces in a new order. If your downstream node needs actual integers, you'll be converting. This is inherited straight from the original LogicUtils port, so it's not a regression in your install; it's just how the node is.

    Also note the output is a list, not a single value. The schema reports STRING and the graph wire will say string, but what actually travels is the shuffled list - the LogicUtil family passes lists this way between its nodes. Point it at a list consumer or an indexing node (like Manual Choice Int fed from the shuffled order), not at a single-value field.

    The seed is the whole point. Shuffle a list of step counts or CFG presets for variety across a batch, then fix the seed when you need to reproduce a specific run - same discipline as locking a sampling seed, applied to ordering. The family is a port of aria1th's ComfyUI-LogicUtils riding inside the JDCN pack from Daxton Caylor and Jerry Davos; the pack's README covers its file and latent batch nodes and never documents these, so the source is the reference.

    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 when your "shuffled ints" arrive as text, remember: this node shuffles strings named after a type - convert, don't fight it.

    CategoryLogicUtil

    Inputs (3)

    NameTypeDefaultDescription
    input_stringSTRING1$2$3
    separatorSTRING$
    seedINT00–9999999999

    Outputs (1)

    NameTypeDescription
    STRINGSTRING