Nodes/BaiduMeux_Comfy Tools/Meux Outpaint Size Preset Node
ComfyUI Node

Meux Outpaint Size Preset Node

Outpainting math, done for you

By fchangjun·Created about a year ago·Updated 5 months ago· 4
Meux Outpaint Size Preset Node
    • safe_left
    • safe_right
    • safe_top
    • safe_bottom
    • target_left
    • target_right
    • target_top
    • target_bottom
    expand_left0
    expand_right0
    expand_top0
    expand_bottom0
    align64

    The most annoying part of outpainting isn't the diffusion - it's the arithmetic. You want to expand a 512×768 image by 200px on each side, feed that into your canvas and pad nodes, and hit "latent size not divisible by 8" at the sampler. MeuxOutpaintSizePresetSafe exists to make that failure mode impossible: it's a pure size calculator that rounds each side's expansion up to a diffusion-safe value before you ever wire it into the graph.

    How it works

    The node takes how much you want to expand on each side and rounds each one up to the nearest multiple of your align value - 8 (the bare minimum for a latent) or 64 (the safer default most SDXL-class models like, since the VAE downsamples by 8 per side). Zero stays zero, which matters: if you only want to extend left and right, the top and bottom outputs come out as 0 and nothing pads them.

    Inputs:

    • expand_left / expand_right / expand_top / expand_bottom - your desired raw expansion per side, 0–4096.
    • align - 8 or 64.

    Outputs:

    • safe_left / safe_right / safe_top / safe_bottom - the rounded-up values you actually feed your padding/canvas node.
    • target_left / target_right / target_top / target_bottom - the raw values you asked for, passed through so you can display or log both.

    Installing it

    Same pack install:

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

    Or install via ComfyUI Manager by searching "Baidu Meux ComfyTools", then restart.

    Why you'd actually reach for it

    The honest pitch: this is a tiny convenience node, and you could absolutely do the rounding with any math node. What it buys you is one thing - you can't forget the rounding. If you outpaint regularly, wiring the safe_* outputs straight into your pad-and-outpaint workflow means the "not divisible by 8" error stops being a thing you see. The align choice is the only real decision, and 64 is the safe default.

    One thing to know: it only computes sizes. It doesn't touch an image or latent - you feed its outputs into your canvas/pad nodes, which is exactly the point. For a pack that's clearly aimed at an internal production pipeline, this is the kind of "why did nobody ship this" utility that quietly saves you a headache on every run.

    Categoryutils/size

    Inputs (5)

    NameTypeDefaultDescription
    expand_leftINT00–4096
    expand_rightINT00–4096
    expand_topINT00–4096
    expand_bottomINT00–4096
    alignCOMBO642 options: 8, 64

    Outputs (8)

    NameTypeDescription
    safe_leftINT
    safe_rightINT
    safe_topINT
    safe_bottomINT
    target_leftINT
    target_rightINT
    target_topINT
    target_bottomINT