Scale-Locked CFG Guider
A guider that patches without mutating — and needs its runtime partner
- guider
- runtime
- lock_mask
- manifold_mask
- guider
This is the node that actually applies the scale-lock math. Where "Scale-Locked Runtime Context" builds the planner trajectory and the aligned noise, Scale-Locked CFG Guider is the denoiser-side correction: it takes a base GUIDER, wraps it with the scale-lock logic, and hands back a new patched guider ready for SamplerCustomAdvanced. A small thing the pack got right: it doesn't mutate the upstream guider object in place, which is a habit too many guider-patching nodes never learned - you can share the base guider elsewhere without it secretly changing under you.
But read the README's warning before you get excited: this node is only the denoiser-side piece. Full Scale-Locked Residual Diffusion behavior depends on the paired runtime context, because the high-res noise field has to be aligned with the low-res planner branch. Patch a guider with this node and skip the runtime context and you'll get a correction with nothing to correct toward. It's a partnership: runtime context builds the plan, this node enforces it.
How it works
You feed it a guider and a runtime (the SLRD_RUNTIME from Scale-Locked Runtime Context), and the usual lock knobs. Internally it patches the guider's denoiser so that during sampling:
- the low-frequency (coarse) denoised structure gets pulled toward the planner's recorded x0 trajectory,
- a separate, looser mid-band lock controls medium-scale shape,
- the model's own high-frequency residual detail is preserved,
- schedules fade the lock from
lock_strength_startdown tolock_strength_endso the image is anchored early and freed up late.
The output is a single guider (GUIDER) - feed that into SamplerCustomAdvanced along with the prepared_noise from the runtime context.
The inputs that matter
The lock knobs mirror the rest of the pack, and the pattern is the same everywhere:
lock_strength(0.85) /lock_strength_start(0.95) /lock_strength_end(0.25) - coarse lock level and envelope.lock_schedule- release shape;hold_then_dropwithlock_schedule_hold~0.35 is the README's first-settings choice.coarse_cutoff(0.33) - lower is stronger global structure control; drop toward 0.25 if drift persists.mid_band_cutoff(0.60) /mid_band_strength(0.35) - the medium-scale lock; your first release valve when output feels over-constrained.manifold_enabled- off by default. The experimental residual/manifold correction; don't flip it on until the basic lock is dialed.lock_mask/manifold_mask(optional MASKs) - spatially restrict the correction.
The workflow it belongs to
- Build your base
GUIDERnormally. - Run Scale-Locked Runtime Context with
noise,guider,sampler,sigmas, and the target latent. - Run this node on the base guider with the returned
runtime. - Feed
prepared_noise+ the patched guider intoSamplerCustomAdvanced.
If you're not building a modular graph and just want the finished image, use ScaleLockedResidualSamplerCustomAdvanced or the all-in-one KSampler instead - this node exists for people who want the pieces, not for everyone.
Install
No extra Python dependencies, no model downloads.
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-ScaleLockedResidualDiffusion
Restart ComfyUI, or install ComfyUI-ScaleLockedResidualDiffusion via ComfyUI Manager.
Troubleshooting
The big one is conceptual: wire this node without a runtime context (or with a runtime built from different inputs) and you'll see little to no effect, because the correction has no planner trajectory to pull toward. If the guider output looks wrong, rebuild the runtime context with the same sampler/sigmas you're about to sample with. And remember - this pack is an honest MVP from a small author; if the lock is fighting an exotic sampler, sampler_guard on the runtime side warns for a reason. Stick to the safe sampler set (euler, heun, ddim, dpmpp_2m, lcm, and the cfg_pp variants) unless you're deliberately experimenting.
Inputs (36)
| Name | Type | Default | Description |
|---|---|---|---|
| guider | GUIDER | — | |
| runtime | SLRD_RUNTIME | — | |
| 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 | — |
| lock_maskopt | MASK | — | |
| manifold_maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| guider | GUIDER | — |