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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| smc_lambda | FLOAT | 0.050–50 | Exponential decay coefficient λ. Paper recommends 5.0 for FLUX/SD3/Wan. |
| smc_k | FLOAT | 0.100–2 | Switching gain K. With adaptive_scale ON: dimensionless ratio of ||e_t||. Safe range: 0.05–0.3. |
| warmup_steps | INT | 20–50 | Initial steps with NO CFG (only cond prediction). SMC starts after warmup. |
| adaptive_scale | BOOLEAN | true | Normalise 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_ratio | FLOAT | 0.250–1 | Hard clamp: ||u_sw|| ≤ ratio * ||e_t||. Set 0.0 to disable. |
| switching_mode | COMBO | smooth | 'hard' = sign(s) – paper default. 'smooth' = tanh(s/δ) – less chattering. |
| tanh_delta | FLOAT | 0.500.0001–5 | Smoothing bandwidth δ for tanh mode. Smaller = closer to hard sign. |
| normalize_s | BOOLEAN | false | Normalise s_t to unit norm before φ (legacy option, independent of adaptive_scale). adaptive_scale is preferred for cross-model safety. |
| smc_end_step | INT | 00–200 | Deactivate SMC after this many steps (fall back to vanilla CFG). 0 = always active. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |