Empty Latent Image From Presets (SD1.5)
SD1.5's trained sizes in a dropdown, latent included
- latent
- w
- h
If you still run SD1.5 models - and plenty of people do, especially for fast tests and big batches - this is the node that replaces the core Empty Latent Image with a dropdown of the sizes that actually make sense for that model. Pick a preset, get the empty latent plus its w and h, wire the latent into the sampler. Same shape as the SDXL version of this node, but tuned to SD1.5's much smaller native resolution.
It's part of nkchocoai's ComfyUI-SizeFromPresets, a pack that's pure utility: size presets stored in a CSV, turned into widths, heights, and empty latents. Nothing to download, nothing to configure.
How it works
Exactly like core ComfyUI's EmptyLatentImage, but with the width/height inputs swapped for a preset lookup:
latent = torch.zeros([batch_size, 4, h // 8, w // 8])
Zeros at 1/8 scale, 4 channels - the sampler adds noise on top. The dropdown is built at import time from presets/sd15.csv, which ships with five entries: 512x512, 768x512, 512x768, 716x403, 403x716. 512x512 is SD1.5's native resolution; the two portrait/landscape 768 variants are the common "slightly above native" stretch; the 16:9-ish 716x403 pair is where it gets interesting.
The inputs that matter
preset- the dropdown. Five options, from the CSV.batch_size- 1 to 4096. Default 1.
Outputs: latent into the sampler, plus w/h INTs.
Where people get burned
One preset's numbers don't add up. 716x403 isn't divisible by 8. The node floors the division (716 // 8 = 89, 403 // 8 = 50), so the latent it builds is 89x50 and decodes to 712x400 - while the w/h outputs report 716 and 403. If you were expecting exact pixels, that 4-pixel/3-pixel shortfall will bite you. The other four presets are divisible by 8 and match exactly. It's a small wart on an otherwise tidy node, and worth knowing before you build a workflow around the numbers.
Also remember this is SD1.5 - going much past 512 (the 768 presets already cost quality) invites the off-native artifacts that the "Resolution wrong" playbook warns about: double heads, stretched limbs, tiling. These presets are the sensible envelope; they're not a license to crank size.
Install and troubleshooting
ComfyUI Manager, search "ComfyUI-SizeFromPresets", install, restart. Or:
cd <ComfyUI>/custom_nodes
git clone https://github.com/nkchocoai/ComfyUI-SizeFromPresets.git
No requirements.txt - only csv, numpy, and torch, all already present. Want a custom size? Add a row to presets/sd15.csv and restart ComfyUI; the dropdown rebuilds from the file at import. Keep the clone named ComfyUI-SizeFromPresets - the code looks up that exact folder to find the CSV, so renaming it breaks the pack. Back up the CSV before editing; a malformed file will fail startup for all ten nodes.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| preset | COMBO | 5 options: 512 x 512, 768 x 512, 512 x 768, 716 x 403, 403 x 716 | |
| batch_size | INT | 11–4096 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| w | INT | — |
| h | INT | — |