Nodes/ComfyUI/Normalized Attention Guidance
ComfyUI Node Runs on cloud

Normalized Attention Guidance

Bring negative prompts back on Turbo, Schnell, and every CFG-1 model

By Comfy-Org·Created 4 years ago·Updated 20 days ago· 121,575
Normalized Attention Guidance
  • model
  • MODEL
nag_scale5.0
nag_alpha0.50
nag_tau1.50

Here's the 2026 situation in one line: most models you'll actually run - Z-Image Turbo, Flux Schnell, every Lightning/Hyper speed checkpoint - are guidance-distilled and run at CFG 1, which means your negative prompt box does nothing. The pass that the negative steers simply isn't computed. NAGuidance - Normalized Attention Guidance - is the built-in fix: it restores negative prompting on those models by intervening in the attention heads instead of the guidance extrapolation, so it works at CFG 1 without you having to crank the scale and burn the image.

NAG has history. It started as Chen Dar-Yen's research project, became the ComfyUI-NAG extension that hit Z-Image Turbo in December 2025 and immediately went around as the answer to "negative prompts don't work on Turbo," and then landed in ComfyUI core in February 2026. If a workflow you downloaded references the old extension node, the built-in NAGuidance is its successor - same idea, zero install.

The honest caveat: NAG is a real but niche tool. The community treats it as a known workaround, not a daily driver, because restating constraints positively ("clean studio background" beats any negative) costs nothing and works everywhere. Reach for NAG when you specifically want negative prompting back - usually for removing something the model keeps drawing.

How it works

NAG patches the output of the model's self-attention (attention block 1). When both a positive and a negative are present in the batch, it computes a guided attention vector: z_pos * nag_scale - z_neg * (nag_scale - 1), then normalizes its magnitude with an L1 norm, caps the correction at nag_tau, and blends it back in. The source also disables the CFG-1 optimization so the negative pass actually runs. Net effect: the negative steers attention, which the model still computes, instead of steering a guidance extrapolation the model never does.

Inputs and what to set

Three floats, and the defaults deserve scrutiny:

  • nag_scale - default 5.0. The guidance strength; higher pushes further from the negative. The author's own guidance is to not exceed 3 - the built-in default is hotter than the paper recommends, so treat 1–3 as the working range.
  • nag_alpha - default 0.5. Blend between the NAG-guided attention and the original. 1.0 is full replacement, 0.0 is no effect. If images get weird or oversharp, pull this down.
  • nag_tau - default 1.5. Caps how far the normalization is allowed to stretch the guided vector. Leave it unless you're chasing a specific behavior.

Output is the patched MODEL for your sampler. Ships with ComfyUI core.

Common issues & troubleshooting

You lose the speed advantage. NAG disables the CFG-1 optimization, so the model runs its second pass again - roughly double the per-step cost. That's the price of negative prompts on a distilled model, and it's why the "just write it positively" advice keeps winning.

No negative, no effect. NAG only activates when both the positive and negative are in the batch. Type nothing in the negative box and the node is a pass-through.

It's flagged experimental. The behavior may shift between ComfyUI updates. It also patches attention for every step with no start/end percent controls - the knobs for that exist in the source as commented-out code, so if you want NAG only during early steps, you're currently out of luck in the built-in version.

Categoryadvanced/guidance

Inputs (4)

NameTypeDefaultDescription
modelMODELThe model to apply NAG to.
nag_scaleFLOAT5.00–50The guidance scale factor. Higher values push further from the negative prompt.
nag_alphaFLOAT0.500–1Blending factor for the normalized attention. 1.0 is full replacement, 0.0 is no effect.
nag_tauFLOAT1.501–10

Outputs (1)

NameTypeDescription
MODELMODELThe patched model with NAG enabled.