Size Presets
Stop typing 1024×1024 — save your favorite resolutions
- width
- height
Every workflow has the same two little number boxes: the width and height on an Empty Latent Image. SD 1.5 lives at 512, SDXL wants one of its five trained ratios (1024×1024, 1152×896, 1216×832…), and whichever model you're on this week, you're retyping those numbers every single time. Size Presets is the fix for that boring, endless repetition: one node with native width/height inputs, four buttons, and a local SQLite library that remembers every resolution you've told it to.
It's pure plumbing in the best sense - no models, no sampling, no magic. Just a value node whose entire job is to make "which size does this workflow use" a one-click decision instead of a typing chore. It's new and largely unproven in the wild, but the idea is exactly the right one.
How it works
The backend is almost embarrassingly small. SizePresets.get_size() just returns (width, height) - the node is a glorified pass-through. Everything that makes it useful lives in the frontend: the JavaScript adds the Load preset, Save preset, Manager, and Switch size buttons to the node, and a small REST API (/size_presets/sizes, /size_presets/categories) talks to a SQLite database that's auto-created at db/presets.sqlite inside the pack folder.
Your presets are keyed by (category, width, height) - the size is the name, so there's no separate "give this preset a name" step. Save 1152×896 into a category called "SDXL" and that's it. The Save dialog rejects a size that already exists in that category rather than silently overwriting it, which is a nice touch - it forces you to keep one canonical entry per resolution instead of accruing duplicates.
The inputs and outputs that matter
- width / height - the only inputs, both
INT, 64 to 8192, stepped by 8. Defaults to 512×512. - width / height outputs - plain
INTs. Wire them straight into Empty Latent Image's width/height, or into any resize/upscale node that takes dimensions.
The step of 8 matters: most latent pipelines want dimensions divisible by 8, and Flux wants multiples of 64 on top of that. The node keeps you on an 8-multiple grid so you don't silently feed a latent a size the VAE can't cleanly encode. The width/height are normal widgets, which means you can also right-click → convert them to inputs and drive them from elsewhere - the same "one source, many consumers" trick the plumbing docs describe for seeds and prompts. And because they're widgets, you can pin them to your ComfyUI favorites for quick access.
Install
No dependencies at all - Python 3.8 stdlib plus SQLite, and no model files to hunt down. Install via ComfyUI Manager (search Size Presets) or:
cd ComfyUI/custom_nodes
git clone https://github.com/StoneZol/comfyui-size-presets.git
Restart ComfyUI (or hot-reload the frontend) and add the Size Presets node. That's the entire setup.
Gotchas worth knowing
Your library lives in the pack's own folder, not ComfyUI's user-data directory. The *.sqlite files are gitignored, so a normal git pull update is safe - but if you ever delete and re-clone the pack, your saved sizes go with it. Back up custom_nodes/comfyui-size-presets/db/ if you build up a library you care about.
Two smaller things. First, duplicate saves are rejected by design, so to change a saved size you use the Manager to edit or delete the old entry rather than re-saving. Second, Switch size just swaps width and height - handy when you flip portrait↔landscape for the same image, and a reminder that this node holds numbers only. It won't rescale anything for you; wire the outputs to a latent or resize node and let those do the real work.
For a workflow that already uses several sizes, this earns its slot fast. For a one-off, the built-in number boxes are fine. It's a small node with a small job - but it's the kind of small that stops you fighting your own graph.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–8192 | — |
| height | INT | 51264–8192 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |