Nodes/Basic data handling/create SET from FLOATs
ComfyUI Node

create SET from FLOATs

Give ComfyUI a pile of floats and get back a set with the duplicates gone

By StableLlama·Created about a year ago·Updated 4 days ago· 48
create SET from FLOATs
    • SET
    item_0

    This node does exactly what its name says - create SET from FLOATs - but the part worth wrapping your head around is what a set is in this pack, because it's not a ComfyUI native type. A SET here is a Python set passed over one wire as a single variable: unordered, no duplicates, lightning-fast membership checks. Feed it a bunch of FLOAT inputs and you get that.

    Why would you want that in an image workflow? Sets are the natural fit for "pool of allowed values." Think of a batch of CFG values you want to test, or a list of denoise strengths - you dump the numbers in, and any repeats collapse for free. Then downstream nodes like contains, length, or sum do the real work. The common mistake is grabbing this when you actually want an ordered, repeatable sequence - that's a LIST, not a SET. The pack's README makes the split clean: use a set when uniqueness matters and order doesn't, a list when order and duplicates matter.

    How it works

    The inputs are dynamic: item_0 is what shows up in the schema, but the node is built so you can keep adding item_1, item_2, and so on from the node's input menu until you've covered everything you want in the pool. Each value gets cast to float and dropped into the set. Two mechanisms worth knowing:

    • Duplicates vanish. Feed in 0.5, 0.75, 0.5 and you get {0.5, 0.75}. That's the feature.
    • Everything must be hashable. Floats are, so you're fine here - but it's why you can't shove a LIST or TENSOR into a set.

    One subtle Python gotcha that bites people: 1 and 1.0 are the same set element. Mix an INT upstream into a FLOAT set and it silently merges with its float twin.

    Inputs and output

    • item_0 (FLOAT) - the first value; add item_1, item_2, … for more. All optional, all cast to float.
    • SET (output) - a single Python set you can wire into any of the other SET nodes in this pack: union, intersection, length, sum, and so on.

    Installing

    This ships in Basic data handling by StableLlama, one of those "just Python utilities, no heavy machinery" packs. Fastest route: ComfyUI Manager → search "Basic data handling" → install → restart ComfyUI. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
    

    Then restart. That's genuinely the whole install - the pyproject declares dependencies = [], so there are no models to download and no pip conflicts to untangle.

    Common issues

    The failure mode isn't the node, it's the type. If you wire the SET output into a node that expects a ComfyUI data list (where each item gets processed individually), things won't behave. Route it through convert to Data List first. And remember: because sets are unordered, whatever ordering you thought you had is gone the moment the set exists. If order matters, reach for a LIST instead.

    CategoryBasic/SET

    Inputs (1)

    NameTypeDefaultDescription
    item_0optFLOAT

    Outputs (1)

    NameTypeDescription
    SETSET