ComfyUI-AutomaticCFG: a self-rescaling CFG patch and why its own README tells you to leave
If your image was a pizza and the CFG the temperature of your oven: this is a thermostat that ensures it is always cooked like you want. Also adds a 30% speed increase. For ComfyUI / StableDiffusion
At a glance
- What is it?
- AutomaticCFG replaces the sampler's CFG scale with a per-step rescaling target inside ComfyUI, and the repository now opens by redirecting users to a successor project. Here is what the node actually does, how to wire it up, and which of its claims the documentation supports.
- Who is it for?
- Adopt AutomaticCFG only if you are already running ComfyUI, your workflow is stable, and you want to try a model patch that turns the CFG slider into an output-intensity target; the README itself now points to Skimmed_CFG and to pre_cfg_comfy_nodes_for_ComfyUI as the maintained successors, so new work should start there instead. Skip it if you depend on SD3 with any boost or uncond-cutting feature, since the README states that combination does not work.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 46 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The problem: CFG as a blunt global dial
In a standard ComfyUI sampling loop the CFG scale is one number applied across the whole run. Push it up and you get stronger prompt adherence along with burned highlights, crushed saturation and the artifacts people call deep-frying. Pull it down and the image goes soft and stops listening to the prompt. The value that works at step 5 is rarely the value that works at step 40, but the sampler has no way to express that. AutomaticCFG is a model patch, listed under the model_patches category, that takes that single number away from the sampler and replaces it with a running target. The README describes the intent plainly: while the node is connected, it will turn your sampler's CFG scale into something else. The audience is ComfyUI users who already have a workflow they like and want to stop babysitting the CFG value between prompts. It is not aimed at people who want a deterministic, reproducible pipeline, because the node changes what the number on the slider means.
How the rescaling actually works, step by step
The mechanism is a per-step rescale of the CFG term based on the statistics of the current latent. According to the README, the node evaluates the potential average min and max values at each step and rescales the CFG so the output lands near a desired intensity, where intensity means overall brightness, saturation and sharpness rather than prompt adherence. The reference values are taken from the upper and lower 25 percent top-k mean, which the author says provides margin for manoeuvre. The target intensity is not fixed. The sampler's CFG scale becomes a multiplier on that target, with a central value of 8: a CFG of 4 aims at half the desired range, and 16 doubles it. That is why the README tells you to set CFG to 8 when you first try the node, and why it warns that your CFG won't be your CFG anymore. The author reports eyeballing the CLI output during sampling and seeing the effective CFG move from roughly 16 early, down to about 4 near the middle, and back to around 7 at the end. Those numbers come from the author's own printed output, not from a published benchmark, and the README says they may have changed after further testing. Treat the shape of the curve as the claim, not the exact values.
The boost toggle, the negative lerp, and where the speed numbers come from
Two features sit on top of the rescaling. The boost toggle turns off negative guidance once the sigmas are near 1, which the README says doubles inference speed. The negative strength control lerps between the conditional and unconditional branches; the README notes that this would normally burn an image, and that it only works here because the rescaling is already an anti-burn mechanism, citing the negative prompt weight repository as the inspiration. Separately there is a warp drive node that the README describes as a new method of the author's own, using the previous step to determine a negative, cutting generation time by half for approximately 3 (the sentence is truncated in the README). The speed claims are stated inconsistently across the file: the top says 160 percent faster gens with the warp drive node, a later update says up to 28.5 percent faster generation speed than normal, and another line says the average speed is 160 percent the normal one when used with the AYS scheduler. Those are three different measurements of three different configurations, and none of them is accompanied by a reproducible test. The honest reading is that the boost and warp drive paths reduce work per step, and the size of the win depends on your scheduler and step count. Verify it on your own hardware rather than trusting a single figure.
Presets are executed, not parsed
This is the part of the README that deserves the most attention. It states that presets are interpreted with eval(), and that you should make sure you trust whoever sent a preset to you because it may be used to execute malicious code. That is not a hypothetical warning about a future feature; it is a description of how the preset system works today. A preset file is therefore equivalent to a script, and sharing presets is equivalent to sharing scripts. If you only ever use the presets that ship with the repository, the exposure is limited to the repository itself. If you download a preset from a forum thread, a Discord message or a workflow bundle, you are running its author's code inside your ComfyUI process with whatever filesystem and network access that process has. The README does not describe a sandbox, a signature check, or a restricted parser. The Apache-2.0 licence covers the code you receive; it does not audit the presets you load.
Getting it running in ComfyUI
The README does not give an installation command, so the only route it documents is placing the repository in your ComfyUI custom nodes directory and restarting, which is the standard layout for a ComfyUI extension and matches the repository's Python source and node registration. Once loaded, the nodes appear under the model_patches category. The documented usage is short: connect the node, set your sampler's CFG scale to 8, and sample. The advanced node exposes the extra controls, and the README says it will not be beneficial to those who do not feel like experimenting. Relevant configuration keys named in the material are the boost toggle, the negative strength lerp (whose scale was divided by two in the 15.04.24 update, so a previous value of 10 becomes 5), the uncond_start_percentage experimental feature added on 16.04.24 for starting guidance later, and start and end sliders on the tweaked SAG node. Those sliders were changed on 17.04.24 to relate directly to sigma values rather than percentages, which the README flags with a warning symbol. If you copied slider values from an older workflow, they now mean something different. The README also notes that if you get an error you should update ComfyUI, and that the unpatch path for turning off the negative is to remove or disconnect the node.
Where it breaks: SD3, sampler coupling, and an abandoned codebase
The clearest limitation is stated by the author: the node works with SD3 only as long as you do not use any boost feature or cut the uncond, which the README says are the same thing. Since the boost toggle is one of the two headline speed features, SD3 users are effectively restricted to the plain rescaling path. Pixart sigma is reported as working, but that is a single sentence with no detail about which samplers were tried. The README also ties the no-uncond approach to specific samplers, noting it seems to work better with dpmpp3m_sde or exponential, which means the sampler choice is not free. The larger issue is maintenance. The README now opens by telling readers to abandon this boat and jump to Skimmed_CFG, and says most of the other functionality has been re-created in pre_cfg_comfy_nodes_for_ComfyUI. Two nodes have already been moved out entirely, Uncond Zero and the temperature nodes, each to its own repository. The last push recorded for this repository is 2026-08-01, but the README's own direction is that the interesting work continues elsewhere. Anyone starting today is adopting a project its author has told them to leave. That is a real cost, not a cosmetic one: fixes for new ComfyUI releases will land in the successor, and the README already warns that version mismatches produce errors.
What to use instead, and the actual difference
The README names two successors, and they are not the same thing. Skimmed_CFG is the replacement the author points to first. pre_cfg_comfy_nodes_for_ComfyUI is described as containing most of the re-created functionality, which suggests it covers the broader node set rather than only the rescaling patch. The difference in approach that matters most is timing: AutomaticCFG is a model patch that intervenes inside the sampling loop, rescaling the CFG term at every step based on the running latent statistics. A pre-CFG node, as the name implies, acts before the CFG computation rather than rewriting it step by step. That changes what you can reason about. A pre-CFG approach keeps the sampler's CFG semantics intact and modifies the conditioning going in, so the number on the slider still means what it meant. AutomaticCFG deliberately breaks that contract, which is why the README has to tell you to set CFG to 8 and stop thinking of it as a CFG. If you want the anti-burn effect without relearning the slider, the pre-CFG route is the more conservative choice. If you want the per-step intensity targeting specifically, that is what this node was built for, and you should check whether Skimmed_CFG carries it forward before installing this repository.
Licence, upgrade cost, and what to check first
The repository is Apache-2.0, which permits commercial use and modification provided you keep the licence and notices, and it includes an explicit patent grant. That covers the code in this repository. It does not cover presets you obtain from third parties, and given the eval() behaviour described above, a preset is a separate artifact with its own provenance and no licence header in practice. On upgrade cost, the README records several breaking changes in a two-month window: the negative lerp scale was halved on 15.04.24, the SAG-style start and end sliders switched from percentages to sigma values on 17.04.24, and the Uncond Zero and temperature nodes were removed to separate repositories. Each of those invalidates saved workflows or saved values. If you pin a ComfyUI version and a node version together, the cost is contained; if you update ComfyUI and expect the node to follow, the README's own advice is to update ComfyUI when you hit an error, which is the opposite of pinning. The concrete check before adopting: open the successor repositories named in the README, confirm whether the rescaling behaviour you want exists there, and only fall back to this repository if it does not.
Editorial conclusion
Adopt AutomaticCFG only if you are already running ComfyUI, your workflow is stable, and you want to try a model patch that turns the CFG slider into an output-intensity target; the README itself now points to Skimmed_CFG and to pre_cfg_comfy_nodes_for_ComfyUI as the maintained successors, so new work should start there instead. Skip it if you depend on SD3 with any boost or uncond-cutting feature, since the README states that combination does not work. Before installing, verify two things: that the preset you load comes from someone you trust, because the README says presets are interpreted with eval() and can execute code, and that the start/end sliders on the SAG-style node are set in sigma values rather than percentages, which changed in the 17.04.24 update. Check the successor repositories for the same functionality before you commit a workflow to this one.
Community notes