Nodes/comfyui-zeug/WidthHeight Tuple to Int
ComfyUI Node

WidthHeight Tuple to Int

The other half of the WxH pair — unpack a resolution

By adrianschubek·Created about a year ago·Updated about a year ago· 1
WidthHeight Tuple to Int
  • wxh
  • width
  • height

ZeugWxHToInt is the decompressor for the pack's WxH type. If ZeugIntToWxH bundles a resolution into one wire, this node tears it back apart into two plain integers - the width and height that every standard ComfyUI node actually understands.

What it is

ZeugWxHToInt lives in the zeug → Convert menu. One input, wxh, of the custom WxH type. Two integer outputs, width and height. Feed it a WxH tuple and the pair comes out as separate INT wires, ready to connect to an Empty Latent, an image scaler, or anything else that wants real numbers.

It exists to close the loop: IntToWxH bundles, WxHToInt unbundles. If you're using the bundle at all, this is the node that turns it back into usable values at the destination.

When you'd reach for it

  • At the end of a WxH "highway" - after carrying a resolution across the graph as one tidy wire, you unpack it here right before it feeds a latent or scaler node.
  • If you're doing math on dimensions - you can't multiply a WxH tuple directly, but you can unpack it, scale one side with an int math node, and re-bundle with ZeugIntToWxH.
  • Any workflow where width and height need to be derived from a single definition point and then split out to several consumers.

How it works

The implementation is a one-line tuple unpack: width, height = wxh, then return both. Nothing is validated, rounded, or reinterpreted - the two integers you put in are the two integers you get out. If you feed it a WxH value from ZeugIntToWxH, the round trip is lossless by construction.

The one thing to internalize (same caveat as its partner): the WxH type is private to comfyui-zeug. The only thing that can produce a wxh wire is ZeugIntToWxH, and the only thing that consumes it is this node. So don't expect to find WxH outputs coming from other packs - this is a self-contained pair, useful for organizing your graph rather than interoperating with the ecosystem.

How to install it

Ships in comfyui-zeug (German for "gear" or "stuff"), a small GPL-3.0 pack by Adrian Schubek:

  • ComfyUI Manager: search zeug in the Custom Nodes Manager, install ComfyUI-Zeug.
  • Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/adrianschubek/comfyui-zeug

Restart ComfyUI. Zero dependencies, no models to download - just torch and ComfyUI's own modules, both already present.

Common issues

There's genuinely little to break, but two things are worth knowing:

  • Missing-node errors on shared workflows. Since the WxH type and both nodes are pack-specific, a workflow that uses them won't load for someone without comfyui-zeug installed. If you share a lot, that's the price of the bundle.
  • Expecting it to accept anything else. It takes a WxH tuple, period. Wire a plain pair of ints into it and ComfyUI will refuse. Bundle with ZeugIntToWxH first.

For keeping resolutions neat in a complex graph, the pair is quietly useful. This node is the payoff at the end.

Categoryzeug/convert

Inputs (1)

NameTypeDefaultDescription
wxhWxH

Outputs (2)

NameTypeDescription
widthINT
heightINT