ER Auto Resolution
This node does the resolution math for your model
- image
- image
- width
- height
Every model family has a native pixel budget, and running off-budget is how you get blurry output or wasted VRAM. SD 1.5 wants around 512×512, SDXL and FLUX.1 want roughly a megapixel, FLUX.2 klein runs at 2MP, Qwen-Image wants its odd 1.76MP sweet spot. Each one also needs its dimensions rounded to the right multiple - 64 for the SD families, 16 for FLUX. And then you still have to pick an aspect ratio. That's the mental math ER Auto Resolution exists to delete.
It's part of the ER VFX Nodepack from Héctor Gallego (ER Academy, a VFX artist working in ComfyUI), and it's about as straightforward as a node gets: you feed it an image, tell it which model you're about to use and what aspect ratio you want, and it resizes to the official-style bucket for that combo. SDXL at 16:9 comes out 1344×768, the canonical number - no calculator involved.
What you set
The three inputs that matter are all enums, so there's nothing to guess:
- model - one of SD 1.5, SDXL/Pony/Illustrious, SD 3/3.5, the FLUX.1 and FLUX.2/Klein options (with their MP budgets), Qwen-Image, or HiDream-I1. Pick the model that's actually downstream in your workflow.
- aspect_ratio - anything from 1:1 to 21:9, or
auto (match input). Auto just picks the listed ratio closest to your source image, which is the right default if you're doing img2img-style work at the source's shape. - mode - the author's own tooltip is the whole story:
cropfills and center-crops,padfits with black bars,stretchdistorts. Crop is the default and usually what you want for latent work.
Under the hood each model has a pixel budget and a rounding multiple; the node does sqrt(pixels × ratio) and rounds both sides down to the multiple, so every output dimension is one your sampler will accept happily. FLUX's 16-multiple quirk (needed for its 2×2 patch grouping) is handled for you.
What comes out
Three outputs: the resized image, plus width and height as INTs. Those last two are the real payoff. Wire them into an Empty Latent's dimensions and you can generate at the correct bucket for your model from scratch; or feed the resized image straight into a VAE encode. Since the image output and the INTs always agree, you can't drift out of sync the way you can when you type the same number into two widgets and forget to update one.
There's also a live label inside the node showing the target size as you flip between models, which makes it a nice teaching tool on its own.
Installing it
ER Auto Resolution ships as part of the ER VFX Nodepack, not as a solo node. In ComfyUI Manager search "ER VFX Nodepack" and install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/esperandoelrender/ComfyUI-ER-VFX-Nodepack.git
Restart ComfyUI and search "ER" in the node menu (it lives under image/transform). No extra Python dependencies and no model downloads - it only uses ComfyUI's own torch/numpy. If you previously installed the individual er_* packs this one grew out of, delete those folders first; they'd register duplicate nodes.
One gotcha worth knowing: this node is a transform, not a lazy helper - whatever mode you pick, it really does resize your image. If you only want the numbers (say, to feed a different node's latent), the output width/height are still there waiting, and the image output is just a pass-through of the same pixels you'd resize anyway.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model | COMBO | SDXL / Pony / Illustrious | 9 options: SD 1.5, SDXL / Pony / Illustrious, SD 3 / 3.5, FLUX.1 (1MP), FLUX.1 (2MP), FLUX.2 / Klein (2MP), +3 |
| aspect_ratio | COMBO | auto (match input) | 10 options: auto (match input), 1:1, 4:3, 3:4, 3:2, 2:3, +4 |
| mode | COMBO | crop | crop: fills and center-crops | pad: fits with black bars | stretch: distorts to fit |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |