Nodes/ComfyUI/CFGZeroStar
ComfyUI Node Runs on cloud

CFGZeroStar

Crank CFG hard without the burn

By Comfy-Org·Created 4 years ago·Updated about 6 hours ago· 129,874
CFGZeroStar
  • model
  • patched_model

The "star" isn't a warning label - it's the math. CFGZeroStar implements CFG-Zero*, an approach that replaces the fixed guidance scale with an optimal scale computed per step, and it exists for one reason: to let you raise CFG for strong prompt adherence without the oversaturation, contrast burn, and plastic skin that normally arrive with it. One model in, one patched model out, zero parameters. It's the cheapest possible upgrade you can hang on a CFG-based workflow, and it's been sitting in ComfyUI core since March 2025 - before most of the other guidance nodes in this family existed.

If you've hit the classic dilemma - CFG 6 and your subject shows up but the image looks airbrushed; CFG 8 and it's deep-fried - this node is aimed exactly at you. It's built from the CFG-Zero* work by Weichen Fan (github.com/WeichenFan/CFG-Zero-star), and the community's been using it where that dilemma bites hardest: people wire it into Wan 2.1 video workflows specifically to push adherence for camera-control prompts without wrecking the footage.

How it works

Standard CFG does uncond + scale * (cond - uncond). The "right" value of scale isn't a constant - it varies per step, per pixel region, per prompt. CFG-Zero*'s insight is that there's an optimal value you can compute on the fly: project the conditional direction onto the unconditional direction and take the ratio. The source implements it as st_star = (v_cond · v_uncond) / ||v_uncond||², then applies a post-CFG correction that shifts the result toward that optimal point.

The arithmetic is one dot product per step. No extra model forward pass, no added VRAM. Compared to CFGNorm or RescaleCFG, which renormalize magnitude, CFGZeroStar re-derives the direction and strength of guidance from the data itself - which is why it degrades more gracefully as you push the scale higher.

Inputs and what to set

Again, nothing:

  • model - the MODEL to patch.

Output is patched_model, fed to your sampler or guider. Ships with ComfyUI core, no install. Note there's a separate CFGZeroStarAndInit node in the community's ComfyUI-KJNodes pack - that's an extension, not this node.

Common issues & troubleshooting

It's a post-CFG patch, so it needs both passes. Like TCFG, on guidance-distilled models at CFG 1 there's no unconditional prediction to work with, and the node has nothing to correct. Use it on models that run real CFG - SD 1.5, SDXL, Wan - not on Turbo/Schnell.

It doesn't replace tuning - it extends your headroom. You'll still find the sweet spot, it's just a wider one. CFGZeroStar lets CFG go higher before artifacts, but push it far enough and the burn returns anyway. The node is a tool for headroom, not a license to ignore CFG entirely.

Expect it to interact with other CFG patches. The source hooks the same post-CFG slot that CFGNorm and SLG use. One correction per chain is the safe pattern; stacking them means they compound in ways nobody documented.

Categoryadvanced/guidance

Inputs (1)

NameTypeDefaultDescription
modelMODEL

Outputs (1)

NameTypeDescription
patched_modelMODEL