Scale-Locked Residual SamplerCustomAdvanced
The scale-lock sampler for people who already live in SamplerCustomAdvanced graphs
- noise
- guider
- sampler
- sigmas
- latent_image
- lock_mask
- manifold_mask
- output
- lowres_planner
- denoised_output
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_dropwithlock_schedule_hold~0.35 is the README's pick for a strong early anchor.coarse_cutoffandmid_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_enabledand 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. Alock_maskover 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, lowercoarse_cutoff, add alock_mask. - Too locked, looks like a low-res upscale → lower
mid_band_strength, raisemid_band_cutoff, lowerlock_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_guarddefaults towarn; set it toerrorif you'd rather the run fail than silently sample with degraded trajectory alignment, oroffif 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.
Inputs (42)
| Name | Type | Default | Description |
|---|---|---|---|
| noise | NOISE | — | |
| guider | GUIDER | — | |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| latent_image | LATENT | — | |
| target_megapixels | FLOAT | 1.000.1–16 | — |
| lock_strength | FLOAT | 0.850–1 | — |
| lock_strength_start | FLOAT | 0.950–1 | — |
| lock_strength_end | FLOAT | 0.250–1 | — |
| lock_schedule | COMBO | 10 options: linear, cosine, flat, smoothstep, smootherstep, ease_in, +4 | |
| lock_schedule_hold | FLOAT | 0.000–0.95 | — |
| lock_schedule_power | FLOAT | 2.00.1–8 | — |
| coarse_cutoff | FLOAT | 0.330.05–1 | — |
| mid_band_cutoff | FLOAT | 0.600.05–1 | — |
| mid_band_strength | FLOAT | 0.350–2 | — |
| mid_band_strength_start | FLOAT | 1.000–1 | — |
| mid_band_strength_end | FLOAT | 0.000–1 | — |
| mid_band_schedule | COMBO | 11 options: linked, linear, cosine, flat, smoothstep, smootherstep, +5 | |
| mid_band_schedule_hold | FLOAT | 0.000–0.95 | — |
| mid_band_schedule_power | FLOAT | 2.00.1–8 | — |
| manifold_enabled | BOOLEAN | false | — |
| manifold_strength | FLOAT | 0.450–1 | — |
| manifold_strength_start | FLOAT | 1.000–1 | — |
| manifold_strength_end | FLOAT | 0.000–1 | — |
| manifold_schedule | COMBO | 10 options: linear, cosine, flat, smoothstep, smootherstep, ease_in, +4 | |
| manifold_schedule_hold | FLOAT | 0.000–0.95 | — |
| manifold_schedule_power | FLOAT | 2.00.1–8 | — |
| manifold_cutoff | FLOAT | 0.180.05–1 | — |
| manifold_radial_strength | FLOAT | 1.000–3 | — |
| manifold_anisotropy | FLOAT | 0.150–2 | — |
| manifold_translation_strength | FLOAT | 1.000–3 | — |
| manifold_anchor_mix | FLOAT | 0.180–1 | — |
| manifold_mean_anchor_mix | FLOAT | 0.120–1 | — |
| manifold_contrast_restore | FLOAT | 0.100–1 | — |
| manifold_energy_tether | FLOAT | 0.000–1 | — |
| manifold_channel_tether | FLOAT | 0.000–1 | — |
| manifold_energy_gain_cap | FLOAT | 1.751–4 | — |
| manifold_max_shift_px | FLOAT | 3.00–64 | — |
| nested_noise_strength | FLOAT | 0.350–4 | — |
| pin_anchors | BOOLEAN | true | — |
| lock_maskopt | MASK | — | |
| manifold_maskopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| output | LATENT | — |
| lowres_planner | LATENT | — |
| denoised_output | LATENT | — |