Nodes/comfyui-outpaintdirectional/πŸ“ Outpaint Direction Selector
ComfyUI Node

πŸ“ Outpaint Direction Selector

One dropdown to rule every pad node in the graph

By hyukudanΒ·Created 2 months agoΒ·Updated 2 months agoΒ· 1
πŸ“ Outpaint Direction Selector
    • direction
    • custom_bias
    β—„directioncenter (50/50 both sides)β–Ί
    β—„custom_bias0.50β–Ί

    Here's a node with no maths in it. OutpaintDirectionSelector takes a dropdown choice and a number and hands them straight back out as wires. That's it - get_direction returns (direction, custom_bias) and does nothing else. No image, no GPU, no surprise.

    So why does it exist? Because of the difference between a value you type and a value you can wire. That distinction is the whole plumbing layer of ComfyUI: convert a widget into an input socket and the value now has one authoritative source that can fan out to as many consumers as you like. Once direction is a socket, you can drive five pad nodes from one dropdown instead of editing five dropdowns and forgetting the sixth, and you can drive it from something other than your mouse.

    What it is meant for

    The realistic case is a graph with more than one canvas operation in it. Vertical reframe pass, horizontal widescreen pass, a re-pad after an upscale - that's three OutpaintDirectionalPad nodes, all of which want to be pointing the same way. Put one selector at the top, convert the direction widget on each pad to an input, wire them all to it, and flipping the format is a single click.

    The other case is automation. Because the output is a wire, a direction can come from a primitive node, a text field you fill in later, or an API payload - which is how you batch a run over several directions without sitting there clicking.

    If you have exactly one pad node, this node is redundant. The pad has the same dropdown built in. Use it there.

    Inputs and outputs

    direction (required) - four choices: center (50/50 both sides), bottom (outpaint TOP only / cielo), top (outpaint BOTTOM only / suelo), and custom_vertical_bias (0.0=bottom, 1.0=top).

    Note what's missing: there is no left or right here. The pad node has six directions; this selector only offers the four vertical ones. If your workflow needs horizontal expansion, the selector cannot drive it and you'll have to set that pad's own dropdown (or give that pad no selector at all).

    custom_bias (optional) - FLOAT, 0.0 to 1.0, step 0.05, default 0.5. Only meaningful when direction is custom_vertical_bias, where it's the fraction of the leftover height placed above the source: 0.0 puts the source at the top edge and 1.0 at the bottom. The label's wording is ambiguous about which end "bottom" refers to - trust the preview on the first run.

    Outputs: direction (type *, ComfyUI's ANY wildcard) and custom_bias (FLOAT), in that order. Wire direction into a converted direction socket on the pad, and custom_bias into the pad's own bias socket. Don't forget the convert step first - right-click the pad's dropdown and choose "Convert widget to input", because a socket has to exist before a wire can reach it.

    The wildcard matters more than it looks. Most of this pack's enum handling downstream is a startswith test on the lowercased string, so what actually travels down that wire is text: anything beginning with bottom anchors low, top anchors high, left/right go horizontal, custom switches to the bias split, and anything unrecognised falls through to the centred default. That means you can legitimately feed a plain string like "top" from a text primitive and it will behave exactly like the dropdown option. It also means a typo won't crash your run - it'll quietly centre the extension instead. Silent-but-sane is the right failure mode for a layout value, but it's a failure mode, so watch the first frame.

    Install

    Same pack, same two ways. ComfyUI Manager β†’ search ComfyUI-OutpaintDirectional β†’ Install β†’ restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hyukudan/ComfyUI-OutpaintDirectional.git
    

    No models, no extra dependencies - torch is already there. If only one of the two selector names shows up in your node search, restart ComfyUI; both are registered from the same __init__.py.

    Troubleshooting

    "I can't connect the output to the pad's direction field." You can, but only after converting the widget to an input. Right-click β†’ Convert widget to input. On the current frontend you can often just drag off the widget to spawn the socket.

    "The direction I selected does nothing." If your source already matches the target aspect ratio, the leftover space in that axis is zero and all four modes produce an identical canvas. Direction only has an opinion when there's something to distribute.

    "The output type is *, can I wire anything?" Technically yes - a model, a latent, a string. The node passes whatever it got straight through as text, so only text-like values are useful.

    The honest summary

    This is a four-choice text box with a wire on it. Nothing about it is impressive, and if you only pad one canvas you will never need it - but it costs nothing, and it removes a whole class of "I changed three of my four pads" mistakes. Worth knowing that its sibling entry, PrimitiveCombo, is the exact same class registered under a second name.

    Categoryimage/outpainting

    Inputs (2)

    NameTypeDefaultDescription
    directionCOMBOcenter (50/50 both sides)4 options: center (50/50 both sides), bottom (outpaint TOP only / cielo), top (outpaint BOTTOM only / suelo), custom_vertical_bias (0.0=bottom, 1.0=top)
    custom_biasoptFLOAT0.500–1β€”

    Outputs (2)

    NameTypeDescription
    direction*β€”
    custom_biasFLOATβ€”