The hard sign(s) creates a random +/-1 pattern in regions where the guidance error is near zero. When amplified by cond_scale (e.g. 12), this produces severe high-frequency noise artifacts, especially on SDXL which has smaller guidance magnitudes than SD3/FLUX. Replace sign(s) with sat(s/phi) — the standard boundary layer approach in practical sliding mode control. phi adapts to the guidance error std so the switching threshold is meaningful across different models. - |s| >> phi: correction = +/-K (same as paper) - |s| << phi: correction = K*s/phi (smooth, proportional) - Near-zero guidance regions get near-zero correction (no noise) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4.9 KiB
4.9 KiB