Tuple multiply
Scale both halves of a pair by the same number
- Tuple
- TUPLE
Once you've bundled a width and height (or an x and y) into one of Derfuu's TUPLE pairs, you often need to scale both numbers together - upscale a size by 1.5, halve an offset, whatever. Tuple multiply does exactly that: it takes a TUPLE and a single multiplier, and returns a new TUPLE with both components scaled by the same amount. It saves you unpacking the tuple, multiplying each number separately, and repacking it - a three-node chain collapsed into one.
How it works
Both values inside the incoming TUPLE get multiplied by Value and repacked into a new TUPLE in the same order. There's no separate multiplier for each half - it's one number applied uniformly, which is exactly what you want for a proportional scale (keeping a width/height pair at the same aspect ratio) and not what you want if the two components need independent treatment (unpack with Tuple to floats and multiply each separately in that case).
The inputs and outputs that matter
- Tuple (TUPLE) - the pair to scale, from
Tuple,Int to tuple, or any other Derfuu node that outputs one. - Value (FLOAT, default 1) - the multiplier applied to both components.
1is a no-op;2doubles both;0.5halves both. - Output: TUPLE - the scaled pair, same shape, ready for the next tuple-consuming node.
Where it fits
The obvious case is proportional resizing: you built a (width, height) tuple for a latent or an image region, and you need it 1.5× bigger for a hires pass without recomputing width and height from scratch and repacking. Tuple multiply does the scale in place. It's also useful on position tuples - scale an (x, y) offset by the same ratio you're scaling a canvas, so a paste position computed for one resolution stays correct at another. Chain it with Tuple to ints afterward if the scaled result needs to land as clean integers before it reaches something like LatentComposite with tuples.
How to install it
ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. 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
Result isn't a clean integer. The output stays FLOAT even if the input tuple started as whole numbers - a multiplier like 1.5 will produce fractional latent or pixel coordinates. Run it through Tuple to ints before feeding a size- or position-sensitive node that expects whole numbers.
Aspect ratio looks off after scaling. Check that both components of the source tuple were actually the pair you think they are - if Value_A/Value_B (or an earlier Tuple swap) put width and height in the wrong slots, multiplying both by the same factor won't fix a pair that was already backwards going in.
Node missing after a pack update. Derfuu's tuple family specifically has a documented history of being renamed or removed between versions without a legacy-labeled fallback - a long-time user reported this happening to the tuple nodes and stopped using the pack over it. If this node loads red in an old workflow, check the current repo for a renamed equivalent before assuming your install is broken. A ModuleNotFoundError about Derfuu_ComfyUI_ModdedNodes_legacy means a duplicated folder; keep exactly one, named Derfuu_ComfyUI_ModdedNodes.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| Tuple | TUPLE | — | |
| Value | FLOAT | 1.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TUPLE | TUPLE | — |