Nodes/ComfyUI-ppm/Tangential Damping CFG (Advanced)
ComfyUI Node

Tangential Damping CFG (Advanced)

Clean up the negative pass with Tangential Damping CFG

By pamparamm·Created 2 years ago·Updated a day ago· 265
Tangential Damping CFG (Advanced)
  • model
  • patched_model
multiplier0.50
sigma_start-1.00
sigma_end-1.00

TCFG - Tangential Damping CFG - is a guidance tweak aimed at the part of classifier-free guidance nobody thinks about: the unconditional (negative) prediction. The paper's pitch is that a chunk of the negative pass points in a direction that's orthogonal to where the positive prompt wants to go, and that orthogonal component is mostly noise that drags quality down. TCFG damps it, nudging the uncond to align with the cond, so the guidance you get is cleaner. This is ComfyUI-ppm's advanced version, with a strength dial and a sigma interval.

How it works

Standard CFG steers by the difference between the conditioned and unconditioned predictions. TCFG (from the paper at arXiv 2503.18137) looks at the uncond prediction and splits it relative to the cond: the part that lines up with the cond direction, and the part that's tangential to it. That tangential slice is treated as low-value - refine the uncond by damping it, and the resulting guidance improves fidelity and detail without you touching CFG or the prompt. The node's own summary puts it plainly: refine the uncond to align with the cond for improving quality.

It's a model patch - MODEL in, patched MODEL out - so it applies during sampling and works with a regular KSampler.

The inputs that matter

  • multiplier (default 0.5) - how hard to damp the tangential component. 0 is effectively off; 1 is full damping. The 0.5 default is a moderate, safe starting point. Push it up for a stronger effect, back off if the image starts losing variety or looking over-smoothed.
  • sigma_start / sigma_end (both default -1) - the noise window to apply TCFG in. -1 on both means "apply across the whole schedule," which is the normal setting - the interval is disabled by default. Set real sigma values only if you want to confine the effect to part of the run.

Output is the patched model (labeled patched_model), wired into your sampler like any other model patch.

Install

No models, no dependencies - pure guidance math.

  • ComfyUI Manager: search "ComfyUI-ppm", install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/pamparamm/ComfyUI-ppm, then restart.

Common issues & troubleshooting

No effect at CFG 1. TCFG operates on the unconditional prediction, and at CFG 1 most samplers don't even compute the uncond pass - there's nothing for it to refine. That means the usual distilled suspects (Flux, Z-Image Turbo, anything running guidance-free at CFG 1) won't respond. This is for models running real CFG above 1: SD 1.5, SDXL and their finetunes.

Over-damping flattens the image. Push multiplier toward 1 and you can smooth away detail and reduce seed-to-seed variety along with the noise. If the output looks a bit lifeless after adding this, pull the multiplier back toward 0.5 or lower.

Stacking with other CFG nodes. TCFG touches guidance, and so do rescale, renorm, dynamic thresholding and the guidance limiter. They can coexist, but stack them one at a time and evaluate each on a fixed seed - piling on four guidance tweaks blind is a reliable way to make things worse and not know which one did it.

Pack rule from the author: if the node throws errors after a pack update, delete it and re-add it to reset its state.

Categoryadvanced/guidance

Inputs (4)

NameTypeDefaultDescription
modelMODEL
multiplierFLOAT0.500–1
sigma_startFLOAT-1.00-1–10000
sigma_endFLOAT-1.00-1–10000

Outputs (1)

NameTypeDescription
patched_modelMODEL