Automatic CFG - Unpatch function(Deprecated)
The deprecated undo button you probably don't need
- model
- MODEL
Yes, it says "(Deprecated)" right in the display name, and that's the first thing to know about this node. It exists to remove one specific thing the Automatic CFG patches install: the pre-CFG hook that turns the negative pass off. You feed it a MODEL and it returns a clone of that model with that one option (sampler_pre_cfg_automatic_cfg_function) popped out of its options dict - so the rest of the patch stays, but the "negative disabled in the tail" behavior goes back to normal.
Why it's deprecated
It's from an era when turning off the negative left state behind that had to be explicitly cleaned up. In the 03.05.24 update the README notes: unpatching now happens automatically when you disconnect or delete the node that set it. In other words, the problem this node solved was fixed by the pack itself - the modern behavior is that unplugging the Automatic CFG node undoes its negative-handling, so the explicit undo node is redundant.
Should you use it?
Almost never. If you have an old workflow that still carries one, it's harmless to leave - it takes a MODEL in, returns a MODEL out, and simply strips a hook that likely isn't there anymore. If you're building a new workflow, don't add it. The scenario that used to justify it - running one branch of a workflow with the negative-skip and one without, from a single patched model - is handled today by just using two model paths and letting disconnection do the cleanup.
That's genuinely the whole node: one required input (model), one output (MODEL), no settings. Install and removal are the pack-wide story:
cd ComfyUI/custom_nodes
git clone https://github.com/Extraltodeus/ComfyUI-AutomaticCFG
If you came here because a workflow was erroring on a missing "Automatic CFG - Unpatch function" node, the fix isn't to find this node - it's to update the pack (or ComfyUI, given the global sampling-patch history). Old workflows from the 2024 era reference nodes that have since been renamed, deprecated, or removed; this is one of the renamed-and-marked-deprecated ones, and the display name is ComfyUI's way of telling you not to build on it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |