ComfyUI Node Runs on cloud

Int to tuple

Pack two integers into Derfuu's TUPLE type

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Int to tuple
    • TUPLE
    Value_A1
    Value_B1

    This one only makes sense once you know Derfuu invented its own data type. A TUPLE here is just two numbers bundled together - almost always a (width, height) or a (size, offset) pair - and several of Derfuu's "tuples" nodes take that bundle as a single input instead of making you wire two separate sockets. Int to tuple is the node that builds one: two integers in, one TUPLE out. It's pure plumbing, and you'll only reach for it because another Derfuu node downstream asks for a TUPLE.

    How it works

    You give it two INT values and it packs them into the pack's TUPLE type in order - Value_A first, Value_B second. Whatever consumes the tuple decides what those two slots mean; for ConditioningSetArea with tuples, for instance, a size tuple is (width, height) and an offset tuple is (x, y). There's no math here, just packaging.

    The inputs and outputs that matter

    • Value_A (INT, default 1) - the first number in the pair.
    • Value_B (INT, default 1) - the second.
    • Output: TUPLE - the bundled pair, fed into a Derfuu tuple-consuming node.

    That's the entire node. The reason to care is what it plugs into, not what it does.

    Where it fits

    Derfuu's tuple nodes are a small self-contained sub-language for driving area-based conditioning off computed numbers. You calculate a width and a height with the math nodes, run each through Integer to make them clean ints, pack them here into a size tuple and an offset tuple, and hand both to ConditioningSetArea with tuples. The payoff is that one computed value can drive an entire region layout - change the base number and the region resizes itself. Without tuples you'd be wiring four separate int sockets and keeping them in sync by hand.

    How to install it

    ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. Or manually:

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

    then restart. No dependencies, no models - plain Python.

    Common issues & troubleshooting

    A node won't accept your tuple. TUPLE is a Derfuu-specific type. Only Derfuu's own tuple nodes understand it - you can't feed it into a native ComfyUI node expecting separate width/height widgets. If you need those, skip the tuple entirely and wire your ints directly.

    Your two values landed in the wrong slots. Order matters. Value_A is the first element, Value_B the second; if a region comes out sideways, you've probably got width and height swapped.

    The tuple node vanished after an update. Worth flagging specifically here: Derfuu's tuple nodes have a documented history of being deleted between versions - one user reported exactly this happening to the tuples nodes and said they'd stopped using the pack over it. If a downloaded workflow's tuple node loads red, the version you have may not include it under that name. Reinstall from the current repo, and if you hit a ModuleNotFoundError about Derfuu_ComfyUI_ModdedNodes_legacy, delete the duplicate folder and keep one named Derfuu_ComfyUI_ModdedNodes.

    CategoryDerfuu_Nodes/Tuples

    Inputs (2)

    NameTypeDefaultDescription
    Value_AINT1-9223372036854776000–9223372036854776000
    Value_BINT1-9223372036854776000–9223372036854776000

    Outputs (1)

    NameTypeDescription
    TUPLETUPLE