ComfyUI Node

Tuple Unpack

Turning one (width, height) into two sockets you can wire

By INuBq8·Created about a month ago·Updated about a month ago· 16
Tuple Unpack
  • tuple_or_list
  • item_0
  • item_1
  • item_2
  • item_3

Tuple Unpack is the second half of the PanelComposer pack's list-handling pair, and it exists to close the loop that List Get Item starts. A (width, height) pair is a perfectly reasonable thing for a node to output - but ComfyUI has no idea what to do with a tuple on a wire. Tuple Unpack splits it into separate sockets you can actually drag onto an EmptyLatentImage.

How it fits the panel workflow

The canonical wiring in this pack goes: Panel Layout Provider → panel_dimensions (a list of (w, h) per panel) → List Get Item picks panel 3 → Tuple Unpack splits that panel's pair → item_0 becomes the width, item_1 the height, and both plug straight into an EmptyLatentImage. One panel per generation run, then you feed the results into Panel Compositor to stitch the page.

Mechanically it's dead simple: it takes any list or tuple, pads it with None up to four slots, and emits item_0 through item_3. All four outputs are wildcard "*" sockets, so like List Get Item it works on any list-shaped thing, not just PANEL_DIMENSIONS.

The inputs and outputs that matter

  • tuple_or_list - the one input. A (w, h) pair, a triple, anything up to 4 elements.
  • item_0 / item_1 - the ones you'll actually use for a panel pair: width and height.
  • item_2 / item_3 - outputs for bigger tuples. Positions beyond the input's length just output None.

Here's the part to remember: four outputs, and no more. Feed it a 6-element list and elements past index 3 get silently dropped. And on a short tuple, the extra sockets don't disappear - they output None. If you wire one of those into a required INT input, downstream nodes see None and you'll get a type error instead of a number. For the panel use case this never bites, because you only fill the two sockets you need. But it's worth knowing before you treat this as a general-purpose unpacker for arbitrary lists.

How to install it

Tuple Unpack ships in ComfyUI-PanelComposer alongside the two panel nodes and List Get Item:

cd ComfyUI/custom_nodes
git clone https://github.com/INuBq8/ComfyUI-PanelComposer

Restart ComfyUI after cloning. ComfyUI Manager users: search "PanelComposer". There are no extra dependencies or model files to download - the pack only needs Pillow, which ComfyUI already bundles.

Common issues

The three things that trip people up are all above: the silent truncation past 4 elements, the None on unused outputs, and (the one genuinely common one) forgetting this node exists and trying to wire a (w, h) tuple straight into EmptyLatentImage, which ComfyUI will just refuse. If you find yourself generating with wrong aspect ratios, it's usually not this node misbehaving - it's the pair getting scrambled somewhere upstream, so verify the (w, h) order coming out of List Get Item before you blame the unpack.

Categoryutils/list

Inputs (1)

NameTypeDefaultDescription
tuple_or_list*

Outputs (4)

NameTypeDescription
item_0*
item_1*
item_2*
item_3*