ComfyUI Node Runs on cloud

hiresfixScale

The model-based upscale step your two-pass workflow is missing

By TinyTerraΒ·Created 3 years agoΒ·Updated 3 months agoΒ· 604
hiresfixScale
  • vae
  • image
  • latent
  • image
β—„model_nameβ–Ύβ–Ί
β—„rescale_after_modeltrueβ–Ί
β—„rescale_methodβ–Ύβ–Ί
β—„rescaleβ–Ύβ–Ί
β—„percent50β–Ί
β—„width1024β–Ί
β—„height1024β–Ί
β—„longer_side1024β–Ί
β—„cropβ–Ύβ–Ί
β—„image_outputβ–Ύβ–Ί
β—„save_prefixComfyUIβ–Ί
β—„output_latenttrueβ–Ί

hiresfixScale is the node that runs your image through a real upscaling model - an ESRGAN-style upscaler like 4x-UltraSharp or Remacri - and then, if you want, re-encodes it back to a latent so you can run a low-denoise second sampling pass. That second part is what separates it from a plain Upscale Image node: it's built for the classic two-pass "hires fix" loop.

Here's the workflow it's designed for: you generate at native resolution (say 1024Γ—1024 for SDXL), run the image through this node with a 4x model, then feed the returned latent into a sampler with denoise around 0.3–0.5. The model upscale adds real pixels (well, sharper pixels - model upscalers like UltraSharp clean up without inventing much), and the low-denoise pass re-adds coherent detail. Without the second pass you'd just have a bigger, slightly cleaner image; with it you get the "hires fix" look that fixes tiling and smudginess at high resolution.

How it works

The mechanism, from the source: it loads your chosen upscale model from the upscale_models folder (model_name), runs ImageUpscaleWithModel, then optionally rescales the result. Finally, if output_latent is on, it VAE-encodes the pixels (cropping to multiples of 8 first - dimensions not divisible by 8 are trimmed from the center, which is why you may see slightly smaller output than expected) and hands you the latent.

The post-model rescale step matters because a 4x upscale can overshoot your VRAM and your composition. You can rescale by percentage (default 50%), to Width/Height, or to longer side - maintain aspect, with rescale_method (lanczos, bicubic, etc.) and crop (center) controlling the resize.

Inputs and outputs

  • model_name - the upscale model; pick from the .safetensors files in ComfyUI/models/upscale_models. You'll need to drop a model there yourself - 4x-UltraSharp is the community default.
  • vae - required, for the latent encode step.
  • image - the input pixels, usually from a sampler's image output or a VAE decode.
  • rescale_after_model - on by default; toggle off to keep the raw model output size.
  • output_latent - on by default, producing the latent output you'll feed the second pass. Turn it off and you just get the image.
  • Outputs: latent and image, plus standard preview/save via image_output / save_prefix.

Installing it

Part of tinyterraNodes:

cd ComfyUI/custom_nodes
git clone https://github.com/TinyTerra/ComfyUI_tinyterraNodes.git

or ComfyUI Manager β†’ tinyterraNodes. No pip dependencies - but you must supply an upscale model file, because none ship with the pack.

Gotchas

The biggest gotcha is a settings trap, not a bug: if output_latent is on but you set image_output to Preview, you'll see the upscaled image in the UI even though the node's actual job is the latent. And if your VAE-encoded latent gets fed straight into a sampler, remember the composition changed relative to your first pass - that's why denoise 0.3–0.5 is the sweet spot; anything much higher and the second pass redraws instead of refining. Also: center-cropping to multiples of 8 means an odd-size source silently loses a few edge pixels, so don't obsess over exact output dimensions from a 1345Γ—769 source.

Category🌏 tinyterra/image

Inputs (14)

NameTypeDefaultDescription
model_nameCOMBO0 options:
vaeVAEβ€”
imageIMAGEβ€”
rescale_after_modelCOMBOtrue2 options: false, true
rescale_methodCOMBO6 options: nearest-exact, bilinear, area, bicubic, lanczos, bislerp
rescaleCOMBO3 options: by percentage, to Width/Height, to longer side - maintain aspect
percentINT500–1000β€”
widthINT102464–16384β€”
heightINT102464–16384β€”
longer_sideINT102464–16384β€”
cropCOMBO2 options: disabled, center
image_outputCOMBO4 options: Hide, Preview, Save, Hide/Save
save_prefixSTRINGComfyUIβ€”
output_latentCOMBOtrue2 options: false, true

Outputs (2)

NameTypeDescription
latentLATENTβ€”
imageIMAGEβ€”