If you’ve ever stared at ComfyUI’s width/height boxes like they’re a cryptic rune tablet, you’re not alone. Smart Resolution Calculator lets you “tell it what you know” (aspect ratio, width, height, or megapixels) and it fills in the rest, while also keeping your numbers model-friendly (divisible by 8/16/32/64).
What this node actually does
You pick an aspect ratio (or pull one from an image), then you toggle on the values you want to control (Width, Height, Megapixels). The node automatically computes whatever is missing and outputs:
width / height
megapixels
a preview grid overlay (so you can sanity-check before you burn GPU time)
and most importantly: a ready-to-use LATENT output you can plug straight into KSampler
Install it (the easy way)
Option A: ComfyUI Registry (recommended)
Open ComfyUI Manager
Search “Smart Resolution Calculator” (or “djdarcy”)
Install, then restart ComfyUI
You’ll find it under: Smart Resolution → Smart Resolution Calculator
Option B: Command line
comfy node install comfyui-smart-resolution-calc
Option C: Git clone
cd ComfyUI/custom_nodes
git clone https://github.com/DazzleNodes/ComfyUI-Smart-Resolution-Calc.git
Restart ComfyUI (or Manager → Refresh Node Definitions).
Quick Start: the 30-second “it just works” setup 🚀
Add Smart Resolution Calculator
Choose an aspect ratio (it defaults to 3:4)
Toggle ON the thing you know (Width or Height or Megapixels)
Watch the other values auto-fill
Connect LATENT → KSampler
That’s it. No more “wait… was 4:5 taller or wider?” spirals.
The 5 calculation modes
The node decides the “mode” based on which toggles are ON (and it tells you in the info output).
1) Height + Aspect Ratio
Toggle HEIGHT
Pick ratio
Width is calculated
2) Width + Aspect Ratio
Toggle WIDTH
Pick ratio
Height is calculated
3) Megapixels + Aspect Ratio
Toggle MEGAPIXEL
Pick ratio
Both dimensions are calculated
4) Width + Height
Toggle WIDTH + HEIGHT
Aspect ratio becomes informational
MP is calculated
5) Default mode (no toggles = autopilot)
Uses 1.0 MP with your selected ratio
“Divisible by” (why this matters more than it sounds)
Diffusion models operate in a compressed latent space, so weird sizes can lead to inefficiency or errors. This node can round your results to be divisible by 8 / 16 / 32 / 64.
The docs describe:
8 as minimum,
16 safer,
32 recommended,
64 “maximum compatibility” (and the default).
Three recipes 🍳
Recipe 1: “I just want a portrait that behaves”
Pick a portrait ratio (ex: 4:5)
Toggle MEGAPIXEL
Set MP to something comfy
Plug LATENT → KSampler
Recipe 2: “Make it exactly Instagram Portrait”
Set ratio to 4:5
Toggle WIDTH
Put width to 1024 (or whatever you like)
Let height auto-calc
Recipe 3: “Match this reference image’s framing”
Connect an image into the node and choose how you want it to behave.
AR Only (flexible): extract the image’s aspect ratio, then you can still scale resolution with MP/Width/Height.
Exact Dims (precise): use the image’s exact dimensions (plus optional scale). If you also had manual width/height toggled, it will warn that manual W/H are ignored.
Snapshot (one-and-done): hit Copy from Image, run once, then optionally disconnect the image and tweak manually.
Bonus: it can also output an IMAGE (not just latent)
This node can generate or transform IMAGE output too:
Transform modes include distort, crop/pad, scale/crop, scale/pad
It can also generate empty images with fill patterns like black, white, custom color, noise, random
So it’s not only a calculator… it can be your “canvas maker” and “pre-resize station” in the same node.
Img2img tip: VAE support is built in (v0.6+)
If you connect a VAE, the node can encode the image output into latent for img2img workflows, and newer releases addressed compatibility issues with nonstandard VAEs (examples mentioned: FLUX, patchified, Stable Cascade, etc.).
Final vibe check âś…
Smart Resolution Calculator is basically a pixel valet: you hand it your intent, it parks the numbers neatly, and your workflow stops smelling like panic algebra. đź§ đź§Ľ


