Nodes/ComfyUI-Apt_Preset/chx_Ksampler_refine
ComfyUI Node

chx_Ksampler_refine

Upscale and re-sample in one node — the hi-res fix pattern, built in

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
chx_Ksampler_refine
  • context
  • image
  • lowCpu
  • context
  • image
upscale_model1xDeJPG_OmniSR.pth
upscale_methodbilinear
Add_img_scale2.0
seed0
denoise0.30
image_outputPreview

"Generate at native resolution, then upscale and run a light second pass to add coherent detail" is one of the oldest and still most reliable tricks in the whole ecosystem - hi-res fix, essentially. chx_Ksampler_refine is that trick as a single node: pick an upscale model and factor, set a low denoise for the second pass, done. No separate upscale node, no manual VAE decode/encode dance between passes.

Why this beats generating big in one shot

Generating directly at a large resolution tends to produce repetition and tiling artifacts, because most checkpoints are trained at a specific native size. The standard fix is two passes: generate at native resolution first, then upscale the result and run a second, low-denoise pass over it - enough to add detail that's coherent with what's already there, not enough to change the composition. This node's Apt_Preset README describes the effect as "secondary sampling repair and refine enlargement... in one step," which is exactly this pattern collapsed into one node instead of an Upscale Image + KSampler pair.

The inputs and outputs that matter

  • context (required) - the pack's pipeline wire, carrying the model/conditioning/latent from your first pass.
  • upscale_model (default 1xDeJPG_OmniSR.pth) - the model-based upscaler used before the second sampling pass. Note the default is a 1x model (a restoration/cleanup model rather than a magnifying one) - the actual size increase comes from Add_img_scale, not necessarily from the upscale model itself, so don't assume you need a 4x ESRGAN-style model here specifically.
  • upscale_method (default bilinear) - the interpolation method used alongside the model upscale; other choices are nearest-exact, area, bicubic, lanczos.
  • Add_img_scale (default 2, range 1–16) - the actual size multiplier. 1.5–2x is the sweet spot the wider community has converged on for hi-res fix; going much higher without matching detail budget tends to look soft rather than sharper.
  • denoise (default 0.3) - the second-pass strength. This is the number that determines "add detail" versus "change the picture" - 0.3–0.5 is the standard range for this kind of refine pass; push higher and you risk shifting the composition you just generated.
  • seed and image_output (Hide/Preview/Save/Hide/Save) - standard sampler controls, the same output-handling enum as basic_Ksampler_simple.
  • Optional image (feed a specific image in rather than relying on context's latent) and lowCpu - a VAEDecodeTiled-typed input, meaning you can route in a tiled VAE decode setup to keep VRAM down on large refine passes rather than decoding the whole image at once.

Outputs: context and the refined image.

Installing it

Through ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

then install.bat on Windows for dependencies, restart. You'll need actual upscale model files (.pth) in your models/upscale_models folder - the pack doesn't ship them, and the node's default filename won't resolve to anything until you've downloaded a matching model.

Common issues

Result looks blurry or over-smoothed rather than more detailed. Check denoise first - too low and the second pass barely does anything beyond a soft upscale; if it's already in the 0.3–0.5 range and still soft, the upscale_model itself matters more than people expect. A cleanup-oriented 1x model plus a low denoise is a gentler combination than pairing a sharpening 4x model with the same denoise.

Composition shifted between the first pass and the refine. denoise is too high for what you want. Pull it down toward 0.2–0.3 if you liked the first-pass composition and only want added detail, not a re-roll.

Running out of VRAM on large images. That's what lowCpu (tiled VAE decode) is for - connect it if you're pushing Add_img_scale high on an already-large base image and hitting memory limits during the decode step.

Dropdown for upscale_model is empty or shows only None. You haven't put any .pth upscale models in models/upscale_models yet - this node won't function meaningfully without one.

CategoryApt_Preset/chx_ksample/ksample

Inputs (9)

NameTypeDefaultDescription
contextRUN_CONTEXT
upscale_modelCOMBO1xDeJPG_OmniSR.pth1 options: None
upscale_methodCOMBObilinear5 options: nearest-exact, bilinear, area, bicubic, lanczos
Add_img_scaleFLOAT2.01–16
seedINT00–18446744073709550000
denoiseFLOAT0.300–1
image_outputCOMBOPreview4 options: Hide, Preview, Save, Hide/Save
imageoptIMAGE
lowCpuoptVAEDecodeTiled

Outputs (2)

NameTypeDescription
contextRUN_CONTEXT
imageIMAGE