Nodes/ComfyUI-Info-Prompt-Toolkit/Split (width x height)
ComfyUI Node

Split (width x height)

Unpack '512x768' into two numbers, no string parsing required

By kinorax·Created 5 months ago·Updated about a month ago· 2
Split (width x height)
  • size
  • width
  • height

Split (width x height) takes an IPT-Size value - the pack's "width x height" bundle - and outputs its two parts as plain width and height integers. It's the mirror image of how the pack's size nodes package dimensions, and it exists for the same interop reason as Split Sampler Params: bundles are great for transport, useless for reaching inside.

The size bundle is a genuinely nice idea. Aspect Ratio to Size computes a resolution from a ratio, Scale (width x height) multiplies one, Set Size Extra persists one - and every one of them moves width+height over a single wire as one coherent value. But there are plenty of nodes in ComfyUI that want a bare width and a bare height as separate INT inputs, and they can't see inside a bundle. This node is the adapter: bundle in, two integers out.

What you get out

  • width (INT) - the horizontal dimension.
  • height (INT) - the vertical dimension.

Both come out as real integers, validated to the pack's sane bounds (16–16384 per side). So you can feed them straight into an Empty Latent, a batch-size math node, or anything with plain INT sockets.

One detail that makes it forgiving: the input parser is loose about what it accepts. It'll take a proper IPT-Size bundle, but also a "512x768"-style string, or even a raw list/tuple of two numbers - it normalizes whatever shape arrives into a width/height pair. If you've ever had to hand-write a regex just to split a "1024x1024" string into integers, you'll appreciate that this just works. If the input can't be read as two integers, it errors loudly rather than silently passing garbage.

How it fits

The intended pairing is with the pack's size-producing nodes: derive a size from an aspect ratio, maybe scale it, then split it at the point where vanilla nodes need the numbers loose. It's also the natural companion to Set Size Extra on the reload path - Get Size Extra restores a bundle from metadata, and Split (width x height) unpacks it for the parts of your graph that weren't bundle-aware.

Install

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt

Or ComfyUI Manager → search "ComfyUI-Info-Prompt-Toolkit" → install → restart. No models, no extra dependencies.

Where people get burned

If you're feeding a "WxH" string in by hand, double-check the format - it expects something like 512x768 (case-insensitive x), and a typo like a comma or a colon will fail validation. And as with every splitter, remember this node is a view, not a copy: it doesn't snap or scale anything, so if you split a size that isn't a clean multiple of 8, you're responsible for handling that downstream. The size nodes handle alignment; this node just reports what it was given.

CategoryInfo-Prompt-Toolkit/ImageInfo

Inputs (1)

NameTypeDefaultDescription
sizeIPT-Size

Outputs (2)

NameTypeDescription
widthINT
heightINT