Nodes/ComfyUI Impact Pack/UnsamplerHookProvider
ComfyUI Node Runs on cloud

UnsamplerHookProvider

Reintroduce model-consistent noise on each upscale step

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
UnsamplerHookProvider
  • model
  • positive
  • negative
  • PK_HOOK
steps25
start_end_at_step21
end_end_at_step24
cfg1.00
sampler_name
scheduler
normalize
schedule_for_iteration

The PK_HOOK counterpart to UnsamplerDetailerHookProvider - same Unsampler idea, running a sampler backwards to work out what noise a region "should" have and then reintroducing it, but applied during each step of an Iterative Upscale instead of each detailer cycle. Per the README: "Apply Unsampler during each iteration. To use this node, ComfyUI_Noise must be installed."

Where a plain resample-based upscaler pass just denoises the enlarged pixels by a fixed amount, this hook re-derives the noise consistent with your model and prompt at a given step and reintroduces it - a more deliberate, if more advanced, way to control how much each iteration changes than the upscaler's own denoise alone gives you. This needs BlenderNeko's ComfyUI_Noise installed separately.

How it works

Functionally identical machinery to UnsamplerDetailerHookProvider: model, positive, negative describe the conditioning the unsample step reasons about; sampler_name/scheduler should match what the rest of your upscale pass uses; steps sets the total schedule length that start_end_at_step/end_end_at_step operate within. cfg near 1 keeps the round trip faithful. normalize matters if the resulting noise feeds something expecting it normalized. The one naming difference from the detailer variant: this uses schedule_for_iteration (simple) instead of schedule_for_cycle, matching the vocabulary of Iterative Upscale's steps rather than a detailer's cycles.

The inputs and output

  • model / positive / negative - same conditioning as the rest of your upscale pass.
  • steps (default 25) - total schedule length.
  • start_end_at_step (default 21) / end_end_at_step (default 24) - where in that schedule the hook operates. Get this to line up with whatever step range the upscaler provider's own sampler is actually running, or the effect ends up incoherent.
  • cfg (default 1) - keep near 1 for a faithful round trip.
  • sampler_name / scheduler - match the rest of your upscale pass.
  • normalize (disable / enable).
  • schedule_for_iteration - currently just simple.

Output is a single PK_HOOK - wire it into the hook slot on an upscaler-provider node (PixelKSampleUpscalerProvider, PixelTiledKSampleUpscalerProvider, or a pipe variant).

How to install it

Via ComfyUI Manager: search ComfyUI Impact Pack, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
python -m pip install -r requirements.txt   # ComfyUI's python; python_embeded on portable

then restart. Also install BlenderNeko/ComfyUI_Noise - required for this hook to function.

Common issues & troubleshooting

Node errors or does nothing. Missing ComfyUI_Noise. Install it and restart.

Upscale passes look incoherent or mushy. Mismatch between start_end_at_step/end_end_at_step here and the step range the upscaler provider's own sampler is actually running for that iteration. These need to agree - the same rule that trips people up on Unsampler nodes generally: rewind and resample steps have to be matched, not guessed independently.

Barely any visible effect. cfg too close to 1 with a narrow step range gives you close to a faithful round trip by design. Widen the step range or, once you understand the baseline, nudge cfg up for a stronger effect.

Do you need this over a normal resample upscale? No, not by default. Most iterative upscales work fine with a plain denoise on the provider node. This is an advanced substitute for that denoise step, worth reaching for once you've hit its limits and want more deliberate control over what noise gets reintroduced at each step.

CategoryImpactPack/Upscale

Inputs (11)

NameTypeDefaultDescription
modelMODEL
stepsINT251–10000
start_end_at_stepINT210–10000
end_end_at_stepINT240–10000
cfgFLOAT1.000–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
normalizeCOMBO2 options: disable, enable
positiveCONDITIONING
negativeCONDITIONING
schedule_for_iterationCOMBO1 options: simple

Outputs (1)

NameTypeDescription
PK_HOOKPK_HOOK