Nodes/FreeU_Advanced/Post-CFG SHIFT
ComfyUI Node

Post-CFG SHIFT

FreeU for the Flux Era

By WASasquatch·Created 3 years ago·Updated 11 months ago· 123
Post-CFG SHIFT
  • model
  • MODEL
steps20
mode
blend1.000
b1.100
apply_fourierfalse
multiscale_mode
multiscale_strength1.000
threshold1
s0.500
force_gain1.00

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:

  1. Scales it: denoised * b.
  2. Blends the original and scaled versions with the chosen mode at blend strength.
  3. Optionally (apply_fourier) shapes the result in the frequency domain with the multiscale_mode preset, s scale, and threshold radius.
  4. Applies a final force_gain multiplier.

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 and linear 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.

Category_for_testing

Inputs (11)

NameTypeDefaultDescription
modelMODEL
stepsINT201–1000Number of steps to apply SHIFT.
modeCOMBOBlend strategy for denoised vs denoised*b (e.g., inject, stable_slerp).
blendFLOAT1.0000–100Blend amount between base and scaled tensors.
bFLOAT1.1000–10Scale factor for the injected path (higher = stronger).
apply_fourierBOOLEANfalseApply frequency-domain shaping (Fourier_filter).
multiscale_modeCOMBOPreset shaping curves for Fourier_filter.
multiscale_strengthFLOAT1.0000–1Intensity of multi-scale shaping [0-1].
thresholdINT11–10Base radius for frequency mask.
sFLOAT0.5000–10Base scale value applied at threshold radius.
force_gainFLOAT1.000–100Final multiplier to boost or attenuate effect.

Outputs (1)

NameTypeDescription
MODELMODEL