Post-CFG SHIFT
FreeU for the Flux Era
- model
- MODEL
Classic FreeU works by patching the UNet's 1280/640-channel blocks - which is great for SD1.5 and SDXL and completely useless on Flux, because Flux's transformer architecture doesn't have those blocks. WAS_PostCFGShift is WASasquatch's answer for that gap, and it comes from the same FreeU_Advanced pack. If the console logs ever print [FluxU], this is the node doing it.
It's a different beast with the same spirit: instead of poking at the model's internals, it works on the denoised latent tensor after classifier-free guidance has merged the conditional and unconditional predictions, on every sampler step. No weights are touched - it's pure post-processing on the tensor that's about to be denoised again.
How it works
At each sampler step, after CFG merges cond/uncond, the node takes the denoised tensor and:
- Scales it:
denoised * b. - Blends the original and scaled versions with the chosen
modeatblendstrength. - Optionally (
apply_fourier) shapes the result in the frequency domain with themultiscale_modepreset,sscale, andthresholdradius. - Applies a final
force_gainmultiplier.
So you're effectively nudging the denoised latent toward a scaled, sometimes frequency-shaped version of itself each step. inject mode is the strong one, stable_slerp and lerp are the smooth ones. The README notes that SHIFT is always-on in Flux - the attention/forward-timestep/wrapper paths are disabled for stability, which is a nice admission that this is a focused experimental tool, not a kitchen sink.
The inputs
All of these are required, but you'll mostly touch a handful:
- model - the checkpoint output (Flux or otherwise); it gets cloned and a post-CFG sampler hook is registered on it.
- steps - how many sampler steps SHIFT applies for (default 20). After that, the hook just returns the denoised tensor unchanged. This is your master "how much" dial.
- mode - blend strategy:
inject(strong),stable_slerp(smooth),lerp(linear), plus the interp family andlinear dodge. - blend - how much of the scaled version goes in (0–100, default 1).
- b - the scale factor on the injected path; higher = stronger effect (default 1.1).
- apply_fourier - enable frequency shaping. Off by default; this is the "make it sharper" switch.
- multiscale_mode / multiscale_strength / threshold / s - the Fourier shaping preset, its intensity, the mask radius, and the base scale at that radius.
- force_gain - final multiplier to boost or attenuate everything (default 1.0).
Output is a single MODEL, wired into your KSampler exactly where the checkpoint's model output went.
Installing it
Same pack as the FreeU nodes. ComfyUI Manager → search FreeU_Advanced → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/FreeU_Advanced
Restart ComfyUI. No requirements.txt, no model downloads - torch only. Category is _for_testing, so it lives in the test section of the node menu.
Troubleshooting
The README is refreshingly honest about the failure mode here: if a multiscale preset gives you flat or gray output, that's the Fourier shaping collapsing the signal. Switch to a stable preset (Sharpen or Pass-Through) or tune threshold and s instead of pushing multiscale_strength higher.
Other than that, the knobs to reach for when it's too subtle are steps, b, and force_gain - in that order. It's an experimental node with the category to prove it, so A/B it against a plain sampler pass. When it works, it's a nice contrast/detail lift on Flux; when it doesn't, reset to stable presets and step away from the multiscale menu.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| steps | INT | 201–1000 | Number of steps to apply SHIFT. |
| mode | COMBO | Blend strategy for denoised vs denoised*b (e.g., inject, stable_slerp). | |
| blend | FLOAT | 1.0000–100 | Blend amount between base and scaled tensors. |
| b | FLOAT | 1.1000–10 | Scale factor for the injected path (higher = stronger). |
| apply_fourier | BOOLEAN | false | Apply frequency-domain shaping (Fourier_filter). |
| multiscale_mode | COMBO | Preset shaping curves for Fourier_filter. | |
| multiscale_strength | FLOAT | 1.0000–1 | Intensity of multi-scale shaping [0-1]. |
| threshold | INT | 11–10 | Base radius for frequency mask. |
| s | FLOAT | 0.5000–10 | Base scale value applied at threshold radius. |
| force_gain | FLOAT | 1.000–100 | Final multiplier to boost or attenuate effect. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |