Nodes/ComfyUI-CFG-Ctrl/SMC-CFG Advanced (CFG-Ctrl)
ComfyUI Node

SMC-CFG Advanced (CFG-Ctrl)

Advanced SMC-CFG node. adaptive_scale (default ON) makes K a safe dimensionless ratio across FLUX, SD3, SDXL, Pony, SD1.5 and any other model. max_correction_ratio provides a hard safety clamp.

By flyghtxmz·Created 5 months ago·Updated 5 months ago· 1
SMC-CFG Advanced (CFG-Ctrl)
  • model
  • model
smc_lambda0.05
smc_k0.10
warmup_steps2
adaptive_scaletrue
max_correction_ratio0.25
switching_modesmooth
tanh_delta0.50
normalize_sfalse
smc_end_step0
CategoryCFG-Ctrl

Inputs (10)

NameTypeDefaultDescription
modelMODEL
smc_lambdaFLOAT0.050–50Exponential decay coefficient λ. Paper recommends 5.0 for FLUX/SD3/Wan.
smc_kFLOAT0.100–2Switching gain K. With adaptive_scale ON: dimensionless ratio of ||e_t||. Safe range: 0.05–0.3.
warmup_stepsINT20–50Initial steps with NO CFG (only cond prediction). SMC starts after warmup.
adaptive_scaleBOOLEANtrueNormalise s_t by ||e_t|| before applying K. Makes K a safe dimensionless ratio across all model types. Disable for the raw paper formulation.
max_correction_ratioFLOAT0.250–1Hard clamp: ||u_sw|| ≤ ratio * ||e_t||. Set 0.0 to disable.
switching_modeCOMBOsmooth'hard' = sign(s) – paper default. 'smooth' = tanh(s/δ) – less chattering.
tanh_deltaFLOAT0.500.0001–5Smoothing bandwidth δ for tanh mode. Smaller = closer to hard sign.
normalize_sBOOLEANfalseNormalise s_t to unit norm before φ (legacy option, independent of adaptive_scale). adaptive_scale is preferred for cross-model safety.
smc_end_stepINT00–200Deactivate SMC after this many steps (fall back to vanilla CFG). 0 = always active.

Outputs (1)

NameTypeDescription
modelMODEL