Upscale By Size
Upscale to an exact target size without cropping, stretching, or blowing up VRAM
- image
- upscaled_image
- final_width
- final_height
Ask any regular about upscaling and the first thing they'll say is: there are two different jobs hiding behind the word. One is "add detail" - that's a generative upscaler like an ESRGAN model or SUPIR, expensive and hallucination-prone. The other is "make it bigger with no new detail, and make it exactly this size" - that's a resize, and it's what ◎ Radiance Upscale By Size is for. It's the deterministic, instant, free-in-spirit end of the spectrum.
This is the node you reach for when a deliverable needs to be, say, 2048x2048 and your render is 1832x2011. It gets you to a target dimension with the aspect ratio respected, using a proper high-quality kernel, in linear light, without invoking a diffusion model. If you only remember one thing from the KB's upscaling essay, it's this: don't throw a generative pass at a problem a Lanczos resize solves in milliseconds with zero risk of inventing a face.
How it works
You give it a target width and height. If maintain_aspect is on (default), it computes a fit inside that box using aspect_mode:
fit- the whole image fits inside the box; one side may come out shorter than the target (pillarbox/letterbox shape).fill- the image fills the box, overflowing on the shorter side (you'd crop the excess yourself).stretch- forces exactly target W×H regardless of aspect (distortion risk, but sometimes that's the brief).
The method dropdown is the kernel pick: lanczos, lanczos4, bicubic, mitchell, catrom, hermite, gaussian, bilinear, nearest. For upscaling, Lanczos or Lanczos4 is the standard recommendation - sharp without the ringing you get from aggressive bicubic. There's also a sharpening amount (default 0.2) applied after the resize.
Where this node gets geeky and good: process_in_linear (default on) does the resize in linear light rather than gamma-encoded sRGB, which keeps highlights honest, and input_color_space (sRGB / Linear / Auto) tells it whether to convert first - set it to Linear or Auto when feeding HDR or already-linear input so you don't double-convert.
The inputs that matter
width/height- target dimensions, 64–16384, stepped to 8px.method- the interpolation kernel;lanczosorlanczos4for clean upscale.maintain_aspect+aspect_mode- the trio above that decides fit vs fill vs stretch.
Outputs: upscaled_image plus final_width and final_height - the actual numbers, which differ from your target when maintain_aspect is on, so you can wire them into downstream nodes that need to know the real size.
How to install it
It's in the radiance pack. ComfyUI Manager → "Radiance", or:
cd ComfyUI/custom_nodes
git clone https://github.com/fxtdstudios/radiance.git
cd radiance
pip install -r requirements_windows.txt
Restart, and find it under FXTD Studios/Radiance/Image.
Common issues
Two classic stumbles. First, expecting it to add detail: it won't, and that's correct behavior - if you need detail, this is the wrong node (the pack has Radiance AI Upscale and Radiance Pro Upscale for that). Second, the process_in_linear default means feeding it already-linear data without setting input_color_space to Linear/Auto can double-convert and slightly shift your colors - it's the one setting worth checking when output doesn't match input. And because it resizes, not regenerates, upscaling past 2x with a kernel shows its limits fast: at big factors you'll see softness, which is exactly when you'd switch to a generative pass or tiled diffusion with ControlNet.
For exact-size delivery, it's the one I'd reach for. Cheap, precise, and it leaves your pixels alone otherwise.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image or batch to resize, display-encoded sRGB or linear float (see input_color_space). Alpha is resized separately. | |
| width | INT | 204864–16384 | Target output width in pixels. |
| height | INT | 204864–16384 | Target output height in pixels. |
| method | COMBO | Resampling kernel, run exactly as named: lanczos (3 lobes), lanczos4, bicubic and catrom (Catmull-Rom), mitchell (B=C=1/3), hermite, gaussian, bilinear, nearest. | |
| maintain_aspectopt | BOOLEAN | true | Keep the source aspect ratio using aspect_mode to fit the width x height box. Off resizes to exactly width x height. |
| aspect_modeopt | COMBO | With maintain_aspect on. fit: largest size inside the box. fill: smallest size covering the box (not cropped, so one side exceeds it). stretch: exactly width x height. | |
| sharpeningopt | FLOAT | 0.200–2 | Unsharp-mask amount (1 px sigma) applied after resizing. 0 = off. |
| process_in_linearopt | BOOLEAN | true | Decode sRGB to linear before resampling and re-encode after, for gamma-correct filtering. Only acts when input_color_space is sRGB; linear/HDR input is never converted. |
| input_color_spaceopt | COMBO | sRGB | Colour space of the input. Linear skips the sRGB-to-linear conversion for HDR/linear input. Auto: Linear when any value is outside 0-1, else sRGB. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| upscaled_image | IMAGE | — |
| final_width | INT | — |
| final_height | INT | — |