Nodes/Mayo Nodes/Mayo SDXL Latent
ComfyUI Node

Mayo SDXL Latent

Empty latent presets plus a seeded aspect-ratio randomizer in one node

By Pasu2k·Created 5 months ago·Updated 2 months ago· 0
Mayo SDXL Latent
    • empty_latent
    • width
    • height
    • batch_size
    aspect_ratio
    orientation
    batch_size1
    custom_width1024
    custom_height1024
    seed0
    randomize_aspect_ratiofalse
    include_custom_in_randomizerfalse
    randomize_orientationfalse

    This is the biggest node in the Mayo Nodes pack, and a genuinely nice take on ComfyUI's stock EmptyLatentImage. Instead of typing 896x1152 from memory, you pick a named aspect ratio. And if you want to churn through compositions, it can randomize both the ratio and the orientation - reproducibly, per seed.

    First, a naming trap: the README calls this "Mayo Aspect Ratio Randomizer", but in the node list it's "Mayo SDXL Latent". Same node. If you loaded a workflow that references one and you see the other, that's why.

    How it works

    It builds an empty latent exactly like the stock node: torch.zeros([batch_size, 4, height // 8, width // 8]) - 4 channels, 8x downscale. That's precisely what SD 1.5, SDXL, Illustrious, and Noob expect. Presets are read from the pack's aspect_ratios.txt at startup; the built-in ones (1:1, 3:4, 5:8, 9:16) are all divisible by 16, which keeps you compatible with most SDXL-era models.

    Randomization is seeded. It calls random.seed(seed) before choosing, so the same seed always picks the same ratio and orientation - seed-farming stays deterministic. Orientation just swaps width and height, so a "3:4 Portrait" becomes "4:3 Landscape" when the toggle flips. And a named preset always overrides the custom sliders; only custom lets the sliders do the work.

    The inputs that actually matter

    • aspect_ratio - the preset list, plus custom for your own dimensions.
    • randomize_aspect_ratio + seed - the pair that makes it a randomizer. Turn it on and the ratio gets rolled per seed; set a fixed seed to repeat a layout.
    • randomize_orientation - flips portrait/landscape at random.
    • batch_size - 1 to 64, if you're batching.

    The JS even greys out irrelevant widgets for you: pick a named preset and the sliders dim; turn on randomization and the ratio dropdown dims. Small touches, but they mean you can't silently fight the node.

    Outputs

    • empty_latent (LATENT) - straight into the sampler.
    • width and height (INT) - handy to wire into conditioning or a text-encode-with-size setup.
    • batch_size (INT) - echoes your input, for bookkeeping.

    Custom presets

    Open aspect_ratios.txt in the pack folder. One name, width, height per line, # for comments, and the dropdown picks them up - after a restart, since the file is read when node definitions load. If the file is unreadable, it logs an error and silently falls back to the built-in defaults, so you won't be left with a broken node.

    The trap worth knowing

    The display name is honest: it's an SDXL/SD 1.5 latent. That 4-channel, 8x layout is wrong for Flux, Wan, or Qwen - those want 16 channels - so don't feed this into a newer-model pipeline and wonder why nothing works. Use it for the SDXL family it was built for.

    Troubleshooting in one breath: sliders doing nothing means a named preset is selected (pick custom); new presets not showing means you didn't restart; and if the randomizer keeps picking the same thing, that's the fixed seed doing its job - vary the seed for variety.

    CategoryMayoNodes

    Inputs (9)

    NameTypeDefaultDescription
    aspect_ratioCOMBO5 options: custom, 1:1 1024x1024, 3:4 896x1152, 5:8 832x1216, 9:16 768x1344
    orientationCOMBO2 options: Portrait, Landscape
    batch_sizeINT11–64
    custom_widthINT102464–8192
    custom_heightINT102464–8192
    seedINT00–18446744073709550000
    randomize_aspect_ratioBOOLEANfalse
    include_custom_in_randomizerBOOLEANfalse
    randomize_orientationBOOLEANfalse

    Outputs (4)

    NameTypeDescription
    empty_latentLATENT
    widthINT
    heightINT
    batch_sizeINT