Mayo SDXL Latent
Empty latent presets plus a seeded aspect-ratio randomizer in one node
- empty_latent
- width
- height
- batch_size
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, pluscustomfor 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.widthandheight(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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 5 options: custom, 1:1 1024x1024, 3:4 896x1152, 5:8 832x1216, 9:16 768x1344 | |
| orientation | COMBO | 2 options: Portrait, Landscape | |
| batch_size | INT | 11–64 | — |
| custom_width | INT | 102464–8192 | — |
| custom_height | INT | 102464–8192 | — |
| seed | INT | 00–18446744073709550000 | — |
| randomize_aspect_ratio | BOOLEAN | false | — |
| include_custom_in_randomizer | BOOLEAN | false | — |
| randomize_orientation | BOOLEAN | false | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| empty_latent | LATENT | — |
| width | INT | — |
| height | INT | — |
| batch_size | INT | — |