TCFG: Tangential Damping CFG (Kwon et al. 2025)
Delete the useless part of your negative and keep the rest
- model
- MODEL
Plain CFG is a subtraction: u + w (c - u). The unconditional prediction u is what the model would do with no prompt at all, and you're pushing away from it. Trouble is, u isn't purely "no prompt" - it carries its own direction, and a chunk of it points somewhere the conditional prediction also points. Pushing away from that shared component is wasted work at best, and at high scales it's a source of artefacts.
TCFG (Kwon et al., CVPR 2025) asks a narrow question: what if you only keep the part of u that's actually opposed to c?
The mechanism
Per sample, stack the two predictions into a 2×N matrix A = [u; c] and take its leading right singular vector v1 - the single direction that best explains both. Then project u onto it and throw the rest away:
v1 = first right singular vector of [u; c]
u' = <u, v1> v1
out = u' + w (c - u')
It's called tangential damping because the discarded piece is the tangential component of u with respect to the shared direction. The 2×N case has a closed form via the 2×2 Gram matrix, so it's a cheap operation - a projection per sample, not a full SVD over the latent.
The paper's recommended scales are lower than you'd expect: SD1.5 7.5, SDXL 5, SD3 7, PixArt-α 4.5. On SDXL the paper's own setting is a reduction from the usual 7, which tells you what the correction is worth on that architecture.
Inputs and output
Two inputs beyond the model, which is about as simple as this pack gets.
model- between the loader and the sampler.scale- thewfor this rule; -1 means "the sampler's cfg", the default and usually correct choice.space- left onauto (the method's own). Worth knowing: the projection is a geometric operation, and geometric operations are exactly the ones whose result depends on the space they're computed in. The pack's rule of thumb is worth remembering - linear rules give the same image in any space, projections and caps do not.
Output: MODEL.
There are no extra knobs by design. TCFG is one geometric correction with a fixed form; if you find yourself wanting to dial it, you probably want APG (eta, norm cap, momentum) or the angle governor instead.
Where it earns its place
It's the cleanest "fix the direction, not the magnitude" node in the paper set. Because it doesn't touch the scale, it doesn't undo the adherence you asked for, and because there's no state and no extra forward pass, it's free at runtime. Chain it before a magnitude correction - TCFG then a rescale at phi 0.7 is a genuinely different image from either alone, and it's the pair I'd try first when cfg 8–10 is producing slightly muddy, over-sharpened structure.
It also plays nicely with the rest of the pack, since it writes the combine stage and every other stage stays active.
Install
Manager → search CFG Megapack → install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/AbstractEyes/comfy-cfg-megapack
No dependencies, no model downloads, nothing to configure. One caveat that's the reverse of the usual: it needs a newer ComfyUI than most packs - it's built on comfy_api.latest and tested on 0.38.0. If the pack doesn't appear in your node list after restarting, that's your first suspect.
Where people get burned
Nothing changed. Two usual causes. First, the shared CFG-function slot: a stock RescaleCFG, Mahiro or RenormCFG node chained after this one wins and TCFG does nothing. Second, you're at cfg 1-ish, where there's no guidance term to correct. CFG Plan Readout on the model settles it in one queue.
Expecting less saturation. TCFG removes a direction; it doesn't shrink magnitude. If your image is oversaturated at cfg 12, TCFG alone won't save it - add Guidance Rescale or SAMG.
Using it at cfg 14 and wondering why it looks subtle. At very high scales the discarded tangential component is a smaller share of a very large push, so the visible change shrinks as the scale climbs. The paper's own scale choices (5 on SDXL) are a hint: this method is for the sane range, not for fighting a cfg you shouldn't have set.
Comparing against ComfyUI's stock nodes. ComfyUI ships Mahiro and RescaleCFG in core; it does not ship TCFG. If you've seen "TCFG" mentioned in an A1111 extension context, that's a different implementation - the pack's version follows the paper's rank-one projection and takes the space into account.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| scale | FLOAT | -1.0-1–100 | The guidance scale w for this rule. -1 uses the sampler's cfg value. |
| space | COMBO | auto (the method's own) | Where the rule is computed. Linear rules give the same image in any space; nonlinear ones do not. 'auto' uses the space the method was published in (noise for most, denoised for APG and the angle rule, velocity for flow models). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |