Scale Image to Total Pixels
The resize node hiding in every SeedVR2 recipe
- image
- IMAGE
If you've downloaded any serious upscaling workflow in the last year, you've met this node even if you never touched it. Scale Image to Total Pixels is the one Comfy Org's own upscaling handbook tells you to reach for, the one sitting between your source photo and SeedVR2 in half the restoration setups on Reddit - and underneath all that, it's just a plain resampler. It calls no API, needs no model files, and can't invent a single pore. It resizes. That's it. And it's still probably the most useful node in the whole image/upscaling family, because it resizes in exactly the way generative upscalers want to be fed.
What it actually is
The four scale nodes in image/upscaling - ImageScale, ImageScaleBy, ImageScaleToMaxDimension and this one - all do the same non-generative job: change pixel count without adding content. The community uses "upscaling" for three different jobs (more pixels, more detail, more pixels over time), and everything in this category only ever does the first. No hallucination risk, runs in milliseconds, and it's the correct answer whenever your source already has the detail you want. The skill is knowing when that's true.
How it works
The math is simple and it explains the name. "Megapixels" here means real pixels: 1 MP = 1024 × 1024 = 1,048,576. The node works out a scale factor as the square root of target pixels over current pixels, applies it to both dimensions so the aspect ratio never changes, and resamples.
scale_by = math.sqrt((megapixels * 1024 * 1024) / (width * height))
new_w = round(width * scale_by)
new_h = round(height * scale_by)
Feed it a 512×512 image at the default 1 MP and you get 1024×1024. Feed it a 1536×1024 image at 1 MP and it downscales to hold the total at a megapixel. That's the whole personality of the node: it normalizes anything to whatever pixel budget you set, up or down, aspect locked.
The inputs that matter
- megapixels - your target pixel budget, 0.01 to 16, default 1. This is the whole node.
- upscale_method - how the resample happens.
lanczosis the sharpest and the community's default;areais your friend when you're shrinking; the rest are taste. - resolution_steps - rounds the output dimensions to a multiple of this number. Leave it at 1 for most work; set it to 8 or 64 when you need output that matches a model's native resolution or a VAE tile grid.
One output, IMAGE, which plugs into anything that takes an image - a VAE encode, a ControlNet, a save node. It's the newest-looking input, resolution_steps, that got hidden away in the "advanced" section on recent frontends, so if you don't see it, that's where it went.
When you'd actually reach for it
This is where the node earns its keep. Comfy Org's February 2026 upscaling handbook recommends downscaling a soft source to 0.35 megapixels with this node before running SeedVR2 - the reasoning being that an out-of-focus image has no detail to recover at full resolution, so you drop it to match its real sharpness and let the model rebuild from a sharper-relative base. The same node appears in the standing photo-restoration recipe, set to 4 MP before the restore pass (8 MP "usually lead[s] to weird results" on consumer hardware). People also use it to normalize a batch of wildly different reference images before feeding an image-edit model - which is exactly why Flux 2's template workflows chain it straight after Load Image.
Where people get burned
The classic mistake is expecting it to add detail. Set 4 MP and the output looks soft, and that's not a bug - you asked for interpolation, and interpolation can't invent what isn't there. That's a job for ImageUpscaleWithModel with an ESRGAN checkpoint or a generative upscaler like SeedVR2, and the two roles are the same "which upscaler" confusion that fills Reddit every week. The other trap is the ceiling: the node itself is cheap, but whatever downstream model you wire a 16 MP image into will happily OOM. And one historical note: this node has been in core since August 2023. The recent fame isn't novelty - it's that generative upscalers made the pre-downscale trick fashionable.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| upscale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| megapixels | FLOAT | 1.000.01–16 | — |
| resolution_steps | INT | 11–256 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |