Nodes/ComfyUI_EmAySee_CustomNodes/EmAySee Dimension Swapper
ComfyUI Node

EmAySee Dimension Swapper

Flip width and height without rewiring your graph

By EmAySee·Created about a year ago·Updated 4 months ago· 2
EmAySee Dimension Swapper
    • WIDTH
    • HEIGHT
    width512
    height512
    swap_dimensions

    Sometimes the entire difference between "I want a portrait image" and "I want a landscape image" is two numbers. This node gives you those two numbers - and a single toggle that swaps them. It's a tiny utility, but it's the kind of thing that saves you from building two parallel branches of a workflow just to try the other orientation.

    How it works

    You give it a width and a height (INTs, stepped by 8 so they stay friendly to latent-space models that work in multiples of 8) and a swap_dimensions dropdown with exactly two choices: No Swap and Swap. If you pick Swap, it returns (height, width). Otherwise it returns (width, height). That's the whole mechanism - no models, no math beyond the swap, no hidden behavior.

    Inputs and outputs

    • width (INT, default 512, 1–4096, step 8)
    • height (INT, default 512, 1–4096, step 8)
    • swap_dimensions (enum: No Swap / Swap)

    Outputs are WIDTH and HEIGHT, both INT. Wire them into an Empty Latent node's dimensions, a KSampler resolution, or any node that takes explicit width/height - you keep one set of numbers feeding the graph, and the toggle decides orientation.

    Where it shines

    Pair it with a seed-driven or conditionally-toggled input and you can batch both orientations in one graph - generate a set of portrait images, flip the toggle, generate the landscape set, without duplicating the sampler chain. The step-8 constraint on the widgets is doing real work here: it keeps whatever you type usable as a latent size, since these models' latent space is 8× per side. The swap itself doesn't validate multiples of 8 - the input widgets do that on the way in.

    Install

    Part of the ComfyUI_EmAySee_CustomNodes pack. ComfyUI Manager → search "EmAySee" → install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
    

    Then restart ComfyUI. No dependencies, no model files - the whole pack runs on what ComfyUI already bundles, and the startup "SPECTRE v5.0" banner is just the pack's intro, not an error.

    The honest take

    It's one if-statement wrapped in a node, and that's fine - that's what half of a utility pack is for. The README is AI-written and stale, so don't go looking there for docs; the node does exactly what the two output names say. If you find yourself swapping orientations a lot, this is cheaper than a full reroute setup, and far less fiddly than building a second branch just to flip two numbers.

    CategoryEmAySee/Dimensions

    Inputs (3)

    NameTypeDefaultDescription
    widthINT5121–4096
    heightINT5121–4096
    swap_dimensionsCOMBO2 options: No Swap, Swap

    Outputs (2)

    NameTypeDescription
    WIDTHINT
    HEIGHTINT