Nodes/comfyui-jk-easy-nodes/JK Easy Upscale (If needed)
ComfyUI Node

JK Easy Upscale (If needed)

Only upscales when the image is actually too small

By kostenickj·Created 2 years ago·Updated 2 years ago· 8
JK Easy Upscale (If needed)
  • image
  • IMAGE
upscale_model
min_dim1024
resampling_method
supersample
rounding_modulus8

The display name is the whole feature: this is a conditional upscale. Instead of always running your image through an upscale model and blindly resizing it, it checks whether the image is already at or above a minimum size, and only does the (slow, GPU-hungry) upscale pass if it actually needs to. Plug it into a pipeline that handles images of unpredictable input size - user uploads, mixed-resolution batches, outputs from different generation steps - and you skip wasted upscale work on anything that's already big enough.

How it works

min_dim (default 1024) is the threshold - the minimum you want the image's smaller dimension to be. If the image already clears that, the node passes it through without running the (comparatively expensive) model-based upscale at all; if it doesn't, it upscales using upscale_model, a dropdown populated from whatever pixel upscale models you've got installed (ESRGAN-family models are the common choice here - the same class of model behind most "pixel upscaler" nodes in ComfyUI).

resampling_method (lanczos / nearest / bilinear / bicubic) controls the interpolation used for any additional resize beyond what the model itself produces - lanczos is the default and generally the sharpest general-purpose choice. supersample toggles whether the resize step supersamples for smoother results (at some extra compute cost). rounding_modulus (default 8) rounds the final output dimensions to a multiple of that number - a real, common requirement in Stable Diffusion pipelines, since most model architectures expect dimensions divisible by 8 (or sometimes 64) and will error or misbehave otherwise.

Output is a single IMAGE.

Where this fits in a workflow

The natural spot is right before anything resolution-sensitive downstream - a detailer pass, a ControlNet preprocessor, a save step with a minimum-size requirement - where you want a size guarantee without paying the upscale cost on images that already meet it. It's a cheaper, more targeted tool than something like SeedVR2 or a full tiled upscale: this node isn't trying to add detail or fix quality, it's purely making sure the pixel dimensions clear a floor.

Installing it

Part of the kostenickj/jk-comfyui-helpers pack - pre-installed on comfy.icu, or cd ComfyUI/custom_nodes && git clone https://github.com/kostenickj/jk-comfyui-helpers.git and restart if you're self-hosting. You'll need at least one upscale model in your models/upscale_models folder for the upscale_model dropdown to have anything to choose from - the node itself doesn't ship a model, it just uses whatever's already installed (grab one like 4x-UltraSharp through ComfyUI Manager's model browser if you don't have one yet). Beyond that, no extra dependencies. This pack overall is a small, low-visibility personal toolkit with essentially no community discussion around it, so the README and the node's own field names are what you have to work from.

Common issues

  • Empty upscale_model dropdown. No pixel upscale model installed - download one (ESRGAN-family models are the standard, widely-compatible choice) and restart.
  • Output dimensions look slightly off from what you expected. That's rounding_modulus doing its job - it forces the final size to a multiple of 8 by default, which can shift your target size by a few pixels. That's normal and usually necessary for downstream model compatibility, not a bug.
  • Nothing seems to happen. If the image already meets min_dim, that's expected - the node is designed to skip the upscale entirely in that case. Lower min_dim if you actually want it to upscale a borderline-sized image.
  • Upscale looks softer than expected. Check resampling_method - nearest and bilinear are faster but visibly softer/blockier than lanczos or bicubic for most photographic content.
CategoryJK Comfy Helpers

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
upscale_modelCOMBO0 options:
min_dimINT10241–48000
resampling_methodCOMBO4 options: lanczos, nearest, bilinear, bicubic
supersampleCOMBO2 options: true, false
rounding_modulusINT88–1024

Outputs (1)

NameTypeDescription
IMAGEIMAGE