Nodes/SDXL_sizing/width, height -> 'WIDTHxHEIGHT'
ComfyUI Node

width, height -> 'WIDTHxHEIGHT'

Two ints in, 'WIDTHxHEIGHT' out

By Ser-Hilary·Created 3 years ago·Updated 2 years ago· 28
width, height -> 'WIDTHxHEIGHT'
    • input_str
    width0
    height0

    get_aspect_from_ints (display name "width, height -> 'WIDTHxHEIGHT'") does exactly what its name says. Two integers in, one string out, formatted as WIDTHxHEIGHT. It's the simplest node in the Ser-Hilary/SDXL_sizing pack, and that's the whole point - it exists to bridge the gap between the pack's string-parsing sizing nodes and everything else in your graph that produces numbers.

    Why it exists

    The main sizing nodes in this pack (sizing_node, sizing_node_basic) take their aspect and original_res as strings you type by hand. That's fine at the keyboard. But the moment you want original_res to be a value that another node computed - a resolution from a crop, a preprocessor, a LoRA's recommended size - you can't wire a number into a string widget. This node is the adapter: connect numbers in, get "800x1200" out, feed that string straight into the sizing node's input. Same for aspect, if you'd rather hand it a ratio as two ints than type "16:9".

    That's the whole mechanism, by the way: f"{width}x{height}". There is no hidden magic, no aspect-ratio inference. What you put in is what comes out, exactly as typed.

    Inputs and outputs

    • width - INT, default 0
    • height - INT, default 0
    • input_str - STRING, "WIDTHxHEIGHT"

    That's the full inventory. Both inputs default to 0, so if you wire nothing it produces "0x0" - which the sizing nodes will happily parse into something degenerate, so this node only earns its keep when it's actually connected to a source of real numbers.

    Install and the one gotcha

    Same as the rest of the pack - ComfyUI Manager → search SDXL_sizing, or git clone https://github.com/Ser-Hilary/SDXL_sizing into ComfyUI/custom_nodes and restart. No dependencies, nothing to download.

    Honest note: most of the time you don't need this node at all, because the string sizing nodes accept "WxH" text natively and you can just type it. Reach for it when a value needs to flow from elsewhere in the graph. And if your dimensions are coming from an actual image rather than two numbers, the pack's other conversion node - get_aspect_from_image - does this job from an IMAGE input, and also hands you the ints directly, which is usually the more convenient route for img2img.

    Categorysizing/input conversions

    Inputs (2)

    NameTypeDefaultDescription
    widthINT00–100000
    heightINT00–100000

    Outputs (1)

    NameTypeDescription
    input_strSTRING