Nodes/ComfyUI-GU_Nodepack/GU Sides Unpack
ComfyUI Node

GU Sides Unpack

The other half of the padding pair — turn the tuple back into numbers

By alexguryev·Created 4 months ago·Updated 23 days ago· 2
GU Sides Unpack
    • top
    • left
    • bottom
    • right
    sides

    GU Sides Unpack is the mirror image of GU Sides Pack: it takes a sides tuple - [top, left, bottom, right] - and splits it back into four separate integers. If you read the Pack article, you know the deal: the pack collapses four outpainting paddings into one wire, and this node is what you use when the group needs to become members again.

    The honest truth is that this node is only useful in one specific scenario, but that scenario is real: you've got a sides tuple from somewhere upstream - from GU Sides Pack, from a preset, from a node that outputs a combined padding - and you need the individual values for something the tuple can't express directly.

    What it does

    One input, sides - the [top, left, bottom, right] integer tuple. Four outputs:

    • top, left, bottom, right - the unpacked integers, one per socket.

    No settings, no options, no behavior to configure. It's a structural node: in [top,left,bottom,right] order, out the four named sockets. The mechanism is return sides[0], sides[1], sides[2], sides[3] - the entire node is that line, and that's fine.

    When you'd actually use this

    Three patterns earn it a place in a graph:

    1. Reordering. You got a tuple in [top,left,bottom,right] order but the consumer needs a different arrangement. Unpack, then re-wire in the order you want - or wire the outputs straight into the inputs of a second GU Sides Pack in the right order, which is the clean way to express "reorder these four."
    2. Asymmetric math. The whole reason to unpack is when one side needs different treatment - "pad the bottom twice as much," "left and right stay zero." Tuples can't compute; integers can. Unpack, do the arithmetic, re-pack.
    3. Feeding nodes with separate per-side inputs. Some outpainting or crop nodes want four separate INT sockets rather than a tuple. Unpack bridges the two conventions.

    Install

    ComfyUI Manager → search "GU Nodepack" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexguryev/ComfyUI-GU_Nodepack
    cd ComfyUI-GU_Nodepack
    pip install -r requirements.txt
    

    Deps: psutil, requests, gu-funclib>=1.9.0. No model downloads. Windows-tested, single-user design.

    The caveats

    The order is a convention, not a universal law - the tuple from this pack is [top,left,bottom,right], and if you plug in a tuple from a different pack with a different ordering, your "top" will quietly be someone else's "left." The input is forceInput, so you can't type values in - it has to come from a wire, which is the correct design but worth knowing before you go hunting for a text field. And at risk of repeating myself from the Pack article: if the outpainting node you're feeding doesn't share this tuple convention, the clean answer is to not use the pair at all and just wire four integers directly. These two nodes are convenience, not necessity.

    CategoryGU_Nodepack

    Inputs (1)

    NameTypeDefaultDescription
    sidesCOMBO4 options: 0, 0, 0, 0

    Outputs (4)

    NameTypeDescription
    topINT
    leftINT
    bottomINT
    rightINT