Nodes/SP-Nodes/SP_HiresGen
ComfyUI Node

SP_HiresGen

Hi-res fix, but as one node with its own upscale/sharpen pipeline

By bananasss00·Created 2 years ago·Updated 6 days ago· 20
SP_HiresGen
  • model
  • positive
  • negative
  • vae
  • samples
  • hires_cfg
  • dynamic_cfg
  • sharpen_cfg_opt
  • image
skip_generationfalse
generation_steps20
sampler_namedpmpp_2m
schedulerkarras
seed0
tile_size1024
tiled_vaefalse
previewsfalse
color_matchtrue

Classic hi-res fix is generate small, upscale, then run a second low-denoise pass so you get detail instead of tiling artifacts. SP_HiresGen takes that idea and turns it into a whole small pipeline in one node: instead of one second pass, it runs however many iterations you configure, each one at a slightly different resolution, step count, CFG, and denoise than the last, with an optional sharpen pass and color-matching bolted on. It's the all-in-one version of the technique described in the "hi-res fix" section of any upscaling guide - generate at native res, then progressively push resolution up while easing the denoise down so later passes add detail without redrawing the composition.

How it works

SP_HiresGen doesn't carry its own settings for the upscale model or the per-iteration schedule - those live in two companion nodes you wire in: hires_cfg (from SP_HiresGen_HiresCfg) picks the upscale model and how many iterations to run, and dynamic_cfg (from SP_HiresGen_Dynamic) defines how megapixels, steps, CFG, denoise, and injected noise ramp from a starting value to an ending value across those iterations. The defaults on that dynamic node tell you the intended shape: denoise starts around 0.55 and ends around 0.3, CFG eases from 5.5 down to 3.5 - early passes are freer to add real detail, later passes are conservative touch-ups. That's the same "lower denoise on the second pass" advice you'll see anywhere hi-res fix is discussed, just extended across more than two steps.

color_match (on by default) fights a real problem with any multi-pass img2img chain: repeated encode/decode and denoise cycles drift the color and tone away from the first pass, and this node corrects for it automatically rather than leaving you to notice a magenta cast three passes in.

Inputs and outputs that matter

  • model, positive, negative, vae, samples - your standard sampling pipeline; samples is the LATENT you're about to hi-res.
  • hires_cfg and dynamic_cfg - required, wired from the two companion config nodes.
  • sharpen_cfg_opt (optional) - from SP_HiresGen_Sharpen, if you want a sharpening pass on top.
  • generation_steps (default 20), sampler_name (default dpmpp_2m), scheduler (default karras), seed - the usual sampling knobs.
  • tile_size (512-2048) and tiled_vae - tile the VAE encode/decode for large outputs on limited VRAM.
  • skip_generation - bypass the hi-res passes entirely, useful for A/B testing against the base image.
  • previews - show intermediate iterations as they run.
  • Output: image, the final upscaled and (if configured) sharpened result.

How to install it

Through ComfyUI Manager: search "SP-Nodes," install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/bananasss00/ComfyUI-SP-Nodes

Then restart ComfyUI. hires_cfg's upscale model defaults to 4x-ultrasharp.pth - UltraSharp is a well-known standalone ESRGAN upscaler in the community, and you'll need the file in your models/upscale_models folder (it's not bundled with the node pack, and the README doesn't ship a download link - grab it from OpenModelDB or wherever your other upscale models came from).

Common issues & troubleshooting

Missing upscale model error. The 4x-ultrasharp.pth default only works if that exact file exists in your upscale models folder; if you're using something else, set the model name in SP_HiresGen_HiresCfg to match what you actually have installed.

Colors shift between passes. Make sure color_match is on - it's the setting that exists specifically to catch this, and it's on by default, so if you're seeing drift, check that nothing turned it off.

Out of VRAM on larger targets. That's what tiled_vae and tile_size are for - enable tiling before you drop your target resolution.

Too soft / over-smoothed after several iterations. That's the expected cost of a heavily-ramped-down denoise curve doing its job conservatively - wire in sharpen_cfg_opt (SP_HiresGen_Sharpen) rather than fighting it by raising end_denoise, which risks redrawing detail you already like.

CategorySP-Nodes/HiresGen

Inputs (17)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
samplesLATENT
hires_cfgSP_HiresGen_HiresCfg
dynamic_cfgSP_HiresGen_Dynamic
skip_generationBOOLEANfalse
generation_stepsINT201–10000
sampler_nameCOMBOdpmpp_2m44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBOkarras9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
seedINT00–18446744073709550000The random seed used for creating the noise.
tile_sizeINT1024512–2048
tiled_vaeBOOLEANfalse
previewsBOOLEANfalse
color_matchBOOLEANtrue
sharpen_cfg_optoptSP_HiresGen_Sharpen

Outputs (1)

NameTypeDescription
imageIMAGE