Nodes/ComfyUI_Mira/Upscale Image By Model Then Resize
ComfyUI Node

Upscale Image By Model Then Resize

Upscale big, land on an exact size

By mirabarukaso·Created 2 years ago·Updated 10 days ago· 206
Upscale Image By Model Then Resize
  • upscale_model
  • image
  • image
resize_scale1.5
resize_method

This node fixes the single most annoying thing about ESRGAN-style upscale models: they only do their one fixed multiplier. A 4x model gives you 4x, take it or leave it. This node runs the model, then resizes the result down to whatever scale you actually asked for. So "I want exactly 1.5x, cleanly" becomes possible with a 4x model - it upscales to 4x, then shrinks to 1.5x, and the shrink step is where the crispness comes from.

That two-step is a legit, well-worn technique, not a gimmick. Pixel upscale models (the ESRGAN/Real-ESRGAN family) are the cheap, fast, non-generative rung of upscaling - milliseconds, tiny VRAM, and they cannot hallucinate new faces, which is exactly what you want when the image is already good and you just need more pixels. The trick this node automates is that running a model at a higher factor and downsampling almost always looks sharper than running a smaller model straight, because the downsample averages away the model's artifacts.

How it works

Two stages. First it passes your image through the loaded upscale_model at that model's native factor - 2x, 4x, 8x, whatever it was trained for. Then it resizes the big intermediate to resize_scale relative to the original, snapping the final width and height to the nearest multiple of 8 (which keeps latents and downstream nodes happy). The author's own rule of thumb is the right one: use a 2x model when you want speed, an 8x model when you want the best result and don't mind the memory.

The inputs that matter

  • upscale_model - the loaded ESRGAN-family model. You feed it from a standard "Load Upscale Model" node. Pick one that matches your content: an anime-6B model for anime, a general 4x model for photos.
  • image - the source.
  • resize_scale - the real final multiplier you want, relative to the input (0.1–8.0, default 1.5). This is the point of the node. 1.5 means the output is 1.5x the original, regardless of whether the model was 4x.
  • resize_method - how the downsample is filtered: lanczos, bicubic, bilinear, nearest, nearest-exact, box, hamming. lanczos is the sensible default for a clean downscale; nearest only if you specifically want hard pixels.

Output is a single image.

Where it fits

This is a pixel rung, so it belongs late in a workflow - after you've fixed faces and hands at native resolution, not before. Upscaling first bakes defects in. And know its lane: it adds pixels, not detail. If a source is soft and you need invented texture - pores, fabric weave - a model upscaler won't give you that; that's a generative job for something like SeedVR2 or a tiled ControlNet pass. For the common case of "my generation is sharp, I just need it bigger at a specific size," this node is exactly the tool, and its high click-through says people find it doing precisely that search.

Install

ComfyUI Manager → Custom Nodes Manager → search ComfyUI_Mira → Install → restart. Or by hand: cd ComfyUI/custom_nodes && git clone https://github.com/mirabarukaso/ComfyUI_Mira.git, then restart ComfyUI. If the pack errors on load, run pip install -r requirements.txt in its folder. The node itself has no model download - but you do need to supply an upscale model (place .pth/.safetensors upscalers in ComfyUI/models/upscale_models/).

Common issues

If the output isn't the size you expected, remember resize_scale is relative to the input, not to the model's factor - set it to the final multiple you want, not to some correction of the 4x. Running out of VRAM usually means the model's native factor blew up a large image before the resize could shrink it; drop to a 2x model, or downscale the source a touch first. And if the result looks soft rather than crisp, try lanczos for the resize method and consider a higher-factor model - upscaling to 8x then down to 2x is the "best result" path for a reason.

CategoryMira/Util/Image

Inputs (4)

NameTypeDefaultDescription
upscale_modelUPSCALE_MODEL
imageIMAGE
resize_scaleFLOAT1.50.1–8
resize_methodCOMBO7 options: lanczos, nearest, nearest-exact, bilinear, bicubic, box, +1

Outputs (1)

NameTypeDescription
imageIMAGE