Nodes/ComfyUI-Pixaroma/Portrait Landscape Pixaroma
ComfyUI Node

Portrait Landscape Pixaroma

One click to flip a size tall or wide

By pixaroma·Created 5 months ago·Updated 4 days ago· 357
Portrait Landscape Pixaroma
    • width
    • height
    width832
    height1216

    Portrait or landscape is the most boring decision in image generation and it still manages to cost you nodes. The ComfyUI-native way to offer both orientations is two WH-style nodes and a switch to flip between them, which is absurd for something that's just reordering two numbers. Portrait Landscape Pixaroma replaces that whole stack: type your two dimensions (or wire them in), tap Portrait or Landscape, and it outputs them arranged in that orientation. One click flips tall to wide and back. No second node, no switch, no rewiring.

    How it works

    The logic is deliberately dumb in the best way. In Portrait the smaller of your two numbers becomes the width and the larger becomes the height - a tall image. In Landscape it's reversed, larger as width. Because the arrangement is decided by a button rather than which field you typed in, the order you enter the numbers never matters. Type 1216 in width and 832 in height, tap Portrait, and out comes a proper 832×1216. That's the entire mechanism, and it's exactly why it never surprises you.

    • width / height inputs - the two dimensions, typed or wired in from another node. Defaults are 832 and 1216 (a portrait-ish pair, fittingly).
    • width / height outputs - the same two numbers, reordered by the selected orientation. Wire them straight into an Empty Latent Image or any size-hungry node.

    Both inputs can be wired from elsewhere, so you can drive it from a Load Image's WIDTH/HEIGHT and flip orientation without touching the loader. The step size is 8 on both fields, matching the pack's other size nodes - diffusion models are generally happiest on multiples of 8, and this keeps you on them by default.

    Why you'd reach for it

    The workflow is "I generate both orientations of the same prompt." You keep one set of numbers in this node, click Portrait, render; click Landscape, render - the latent, and anything downstream reading WIDTH/HEIGHT, follows along. It's also the cheap way to add an orientation toggle to a workflow you share: one small node instead of explaining to someone which of two size nodes to bypass. If you need full manual control over both values instead, the sibling WH Pixaroma is the two-fields version; Portrait Landscape is specifically for when orientation is the variable.

    Install

    Part of the Pixaroma pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/pixaroma/ComfyUI-Pixaroma
    

    or ComfyUI Manager → Pixaroma → install, restart. No dependencies, works in both the classic and the new node interface, and all settings save with the workflow. If the node looks wrong after a pack update, it's the browser cache - hard-refresh with Ctrl+Shift+R.

    Category👑 Pixaroma/🔢 Values

    Inputs (2)

    NameTypeDefaultDescription
    widthINT8328–16384One of your two dimensions. Type a value or wire a number in. Portrait/Landscape decides whether this becomes the long or short side, so the order you enter the two numbers does not matter.
    heightINT12168–16384The other dimension. Type a value or wire a number in.

    Outputs (2)

    NameTypeDescription
    widthINTThe output width. In Portrait this is the smaller of your two numbers; in Landscape it is the larger. Rounded to the nearest step when one is set on the node.
    heightINTThe output height. In Portrait this is the larger of your two numbers; in Landscape it is the smaller. Rounded to the nearest step when one is set on the node.