Nodes/ComfyUI-ScaleLockedResidualDiffusion/Scale-Locked Residual SamplerCustomAdvanced
ComfyUI Node

Scale-Locked Residual SamplerCustomAdvanced

The scale-lock sampler for people who already live in SamplerCustomAdvanced graphs

By xmarre·Created 6 months ago·Updated 6 months ago· 2
Scale-Locked Residual SamplerCustomAdvanced
  • noise
  • guider
  • sampler
  • sigmas
  • latent_image
  • lock_mask
  • manifold_mask
  • output
  • lowres_planner
  • denoised_output
target_megapixels1.00
lock_strength0.85
lock_strength_start0.95
lock_strength_end0.25
lock_schedule
lock_schedule_hold0.00
lock_schedule_power2.0
coarse_cutoff0.33
mid_band_cutoff0.60
mid_band_strength0.35
mid_band_strength_start1.00
mid_band_strength_end0.00
mid_band_schedule
mid_band_schedule_hold0.00
mid_band_schedule_power2.0
manifold_enabledfalse
manifold_strength0.45
manifold_strength_start1.00
manifold_strength_end0.00
manifold_schedule
manifold_schedule_hold0.00
manifold_schedule_power2.0
manifold_cutoff0.18
manifold_radial_strength1.00
manifold_anisotropy0.15
manifold_translation_strength1.00
manifold_anchor_mix0.18
manifold_mean_anchor_mix0.12
manifold_contrast_restore0.10
manifold_energy_tether0.00
manifold_channel_tether0.00
manifold_energy_gain_cap1.75
manifold_max_shift_px3.0
nested_noise_strength0.35
pin_anchorstrue

If your workflow runs on SamplerCustomAdvanced, the all-in-one Scale-Locked Residual KSampler is a foreign object: it wants a model, positive and negative when you've already built a custom guider and a sampler, and rewiring just to fight high-res drift is a drag. This node is the drop-in for exactly that situation. It takes the same five inputs as SamplerCustomAdvanced - noise, guider, sampler, sigmas, latent_image - and gives you the same three latent outputs, but it runs the whole Scale-Locked Residual Diffusion pipeline internally instead of a plain sample.

Under the hood it's the compact version of the pack's modular graph. The README is explicit: this node calls the same runtime builder and guider patcher that power the public "Scale-Locked Runtime Context" and "Scale-Locked CFG Guider" nodes, rather than duplicating the planner/noise logic. So you're not getting a different algorithm in a different skin - you're getting the modular graph collapsed into one node, which is exactly the right trade for a graph that already has all the pieces wired.

How it works

Give it your existing guider and sampler, and it runs a low-res planner pass at target_megapixels, caches the planner's per-step denoised x0 trajectory, builds nested high-res noise that shares the planner's coarse stochastic layout, then samples with the scale-lock correction applied on top of your guider: coarse structure pulled toward the planner trajectory, a looser mid-band lock, and the model's high-frequency residual detail preserved. The scale-lock wraps whatever guidance your guider already carries, so the correction is additive - your existing CFG setup stays as it is.

The inputs that matter

Beyond the five wired inputs, the dials mirror the all-in-one sampler:

  • target_megapixels - planner resolution. Default 1.0, which is the README's recommended starting point for a ~4MP high-res target.
  • lock_strength / lock_strength_start / lock_strength_end - the coarse lock's overall level and its schedule envelope. Start at 0.85 / 0.95 / 0.25.
  • lock_schedule - the shape of the release. hold_then_drop with lock_schedule_hold ~0.35 is the README's pick for a strong early anchor.
  • coarse_cutoff and mid_band_cutoff / mid_band_strength - lower coarse cutoff = tighter global structure control; the mid-band is the medium-scale shape lock and your first "too constrained" dial.
  • nested_noise_strength - how much independent high-frequency detail the high-res noise carries. More freedom, more drift risk.
  • manifold_enabled and friends - off by default. This is the more experimental residual/manifold correction; leave it alone until the basic lock is doing its job.
  • lock_mask / manifold_mask (optional MASKs) - restrict the correction spatially. A lock_mask over body/face/hands is recommended for anatomy-sensitive work.

Outputs are output (final high-res latent), lowres_planner (the planner's own result), and denoised_output (final denoised x0 when available).

Install

Same as every node in this pack - no extra dependencies, no model files.

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-ScaleLockedResidualDiffusion

Then restart ComfyUI. Or find ComfyUI-ScaleLockedResidualDiffusion in ComfyUI Manager.

Troubleshooting

  • Still drifting → raise lock_strength, lower coarse_cutoff, add a lock_mask.
  • Too locked, looks like a low-res upscale → lower mid_band_strength, raise mid_band_cutoff, lower lock_strength / lock_strength_end. The mid-band controls are your release valve.
  • Sampler warnings → the pack keeps a conservative safe-set of samplers it's validated (euler, heun, ddim, dpmpp_2m, lcm and their cfg_pp variants). sampler_guard defaults to warn; set it to error if you'd rather the run fail than silently sample with degraded trajectory alignment, or off if you're experimenting and know what you're doing.

The one real gotcha is expectation management: this is an honest MVP from a small pack, not a mathematically complete research system. It attacks exactly the "composition/anatomy/identity drift at high resolution" problem, and if you already run SamplerCustomAdvanced it's the least-effort way to get that correction without rebuilding your graph.

Categorysampling/scale_locked

Inputs (42)

NameTypeDefaultDescription
noiseNOISE
guiderGUIDER
samplerSAMPLER
sigmasSIGMAS
latent_imageLATENT
target_megapixelsFLOAT1.000.1–16
lock_strengthFLOAT0.850–1
lock_strength_startFLOAT0.950–1
lock_strength_endFLOAT0.250–1
lock_scheduleCOMBO10 options: linear, cosine, flat, smoothstep, smootherstep, ease_in, +4
lock_schedule_holdFLOAT0.000–0.95
lock_schedule_powerFLOAT2.00.1–8
coarse_cutoffFLOAT0.330.05–1
mid_band_cutoffFLOAT0.600.05–1
mid_band_strengthFLOAT0.350–2
mid_band_strength_startFLOAT1.000–1
mid_band_strength_endFLOAT0.000–1
mid_band_scheduleCOMBO11 options: linked, linear, cosine, flat, smoothstep, smootherstep, +5
mid_band_schedule_holdFLOAT0.000–0.95
mid_band_schedule_powerFLOAT2.00.1–8
manifold_enabledBOOLEANfalse
manifold_strengthFLOAT0.450–1
manifold_strength_startFLOAT1.000–1
manifold_strength_endFLOAT0.000–1
manifold_scheduleCOMBO10 options: linear, cosine, flat, smoothstep, smootherstep, ease_in, +4
manifold_schedule_holdFLOAT0.000–0.95
manifold_schedule_powerFLOAT2.00.1–8
manifold_cutoffFLOAT0.180.05–1
manifold_radial_strengthFLOAT1.000–3
manifold_anisotropyFLOAT0.150–2
manifold_translation_strengthFLOAT1.000–3
manifold_anchor_mixFLOAT0.180–1
manifold_mean_anchor_mixFLOAT0.120–1
manifold_contrast_restoreFLOAT0.100–1
manifold_energy_tetherFLOAT0.000–1
manifold_channel_tetherFLOAT0.000–1
manifold_energy_gain_capFLOAT1.751–4
manifold_max_shift_pxFLOAT3.00–64
nested_noise_strengthFLOAT0.350–4
pin_anchorsBOOLEANtrue
lock_maskoptMASK
manifold_maskoptMASK

Outputs (3)

NameTypeDescription
outputLATENT
lowres_plannerLATENT
denoised_outputLATENT