Hook Recenter XL
Recentering for SDXL from the conditioning path
- prompt
- CONDITIONING
Hook Recenter XL is the SDXL flavor of the pack's conditioning-path recenter node. Same trick as Hook Recenter - a CONDITIONING in, the same CONDITIONING out, and a hook installed that recenters your latent channels while sampling - but with the color controls remapped for SDXL's latent. If you've been fighting a warm or green cast on an SDXL checkpoint and want to keep your own KSampler and your own conditioning wiring, this is the node from this pack's middle era that fits the cleanest.
How it works
It stores your target means and strength, then wraps ComfyUI's sampling functions - comfy.sample.sample for normal samplers, or comfy.sample.sample_custom when the custom_sampler toggle is on. Every step after that, each latent channel is nudged toward its target: x[channel] += (target[channel] - x[channel].mean()) * strength.
The SDXL difference is the color model exposed on the front panel. Where the SD 1.5 Hook Recenter gives you C/M/Y/K, this node exposes L, a, b - a Lab-style lightness-plus-opponent-color split that maps onto the latent's meaningful axes, mapped internally as [L, -a, b]. All three default to 0, i.e. "pull toward neutral." That's the sensible starting point for SDXL, since checkpoints differ wildly in native color bias.
The inputs that matter
- prompt -
CONDITIONING. Passes through unchanged; its real job is ordering (the node executes when conditioning is evaluated, before the sampler runs). - custom_sampler - boolean, default off. Turn it on if your workflow uses advanced/custom sampling that routes through
sample_custom. - strength - 0 to 1, default 0. Effect volume; 0 = no-op.
- L (default 0), a (default 0), b (default 0) - target means for the three color axes. Start at 0 for a neutral pull, then bias the axis that matches your cast.
Output: CONDITIONING, wired to your KSampler's positive or negative input as usual.
The caveats that come with the design
- The hook patches module-level functions, so it's effectively global for the run - every sampler that executes after it gets recentered, not just the one you wired. The pack's
Unhook Recenternode (same era) restores the originals to turn it off; in the current v2 release that job isDisable CG. - Not all samplers cooperate. The pack's README known issue applies here too, and low-step/distilled samplers (LCM, Turbo) are the usual places the effect silently doesn't show.
- Version note: this is from the "complete rewrite" era of the pack. The current v2 release ships only
Diffusion CG(recenter + normalization in one node, works for SDXL) andDisable CG. If you install today and don't see Hook Recenter XL, that's expected - useDiffusion CGinstead.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Haoming02/comfyui-diffusion-cg
Restart ComfyUI. Zero dependencies, no model files.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | CONDITIONING | — | |
| custom_sampler | BOOLEAN | false | — |
| strength | FLOAT | 0.00–1 | — |
| L | FLOAT | 0.00-1–1 | — |
| a | FLOAT | 0.00-1–1 | — |
| b | FLOAT | 0.00-1–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |