ComfyUI Node Runs on cloud

WanVideoNAG

Negative prompts for Wan when speed LoRAs force CFG 1

By kijai·Created 3 years ago·Updated about 13 hours ago· 2,930
WanVideoNAG
  • model
  • conditioning
  • model
nag_scale11.000
nag_alpha0.250
nag_tau2.500
input_type
inplacefalse

If you run Wan 2.2 the way most people do - with a speed LoRA like LightX2V or CausVid stacked on to cut it to a handful of steps - you've probably noticed your negative prompt stopped mattering. That's not a bug. Speed LoRAs force CFG 1.0, and at CFG 1 there's no classifier-free guidance, so the negative prompt has nothing to act through. WanVideoNAG gets negative control back without giving up the speed LoRA.

It's the same trick as the LTX version in this pack: NAG (Normalized Attention Guidance, by ChenDarYen) reintroduces a negative signal by operating inside the model's attention rather than through a second guidance pass. As the community summarized it, NAG "allows you to use negative prompts on distilled models such as Kontext Dev (CFG 1)," and one of the earliest test reports was someone trying it on Wan FusionX at CFG 1.0 and finding prompt adherence "seems better." Kijai - who also wrote ComfyUI-WanVideoWrapper - built this native Wan node so you don't need the separate ComfyUI-NAG pack.

How it works

You hand it your Wan model plus a conditioning to steer away from, and it patches the model so sampling nudges the attention maps against that concept. Out comes a MODEL you feed to your sampler. Because it works in attention space, it doesn't care that CFG is pinned at 1 - that's the whole point.

The inputs and outputs that matter

  • model (MODEL) in, model (MODEL) out - wire the output into your KSampler.
  • conditioning (CONDITIONING) - your negative. This is the required input that makes the node do anything; encode the stuff you don't want (extra limbs, plastic skin) and plug it in here. Note the difference from the LTX-2 sibling: here the negative is a required input on the node, not an optional side channel.
  • nag_scale (default 11) - strength. The knob you'll actually adjust; turn it up if the negative isn't biting.
  • nag_alpha (0.25) and nag_tau (2.5) - normalization internals, best left at defaults.

Two optional inputs: input_type (default / batch) for how the conditioning is shaped, and inplace (default false) for whether it patches in place.

How to install it

Via ComfyUI Manager: search KJNodes for ComfyUI, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-KJNodes
pip install -r ComfyUI-KJNodes/requirements.txt

then restart. No heavy dependencies - the pack keeps them minimal on purpose, and this node patches your existing Wan model rather than downloading anything.

Common issues & troubleshooting

You're at CFG > 1, so this is redundant. If you're running full-quality Wan without a speed LoRA (CFG 3.5+), ordinary negative prompts already work. WanVideoNAG earns its place specifically on the fast, CFG-1 path - that's where a normal negative is dead.

It conflicts with your cache. NAG's known incompatibility since launch is with TeaCache-style caching. If your Wan graph has a cache node and NAG does nothing or errors, remove the cache and retest.

The effect is weak. Push nag_scale up - the default is a starting point, not a ceiling - and make sure the conditioning you fed it is a genuine negative, not an empty or zeroed one.

Face consistency wobbles. Speed-LoRA Wan already trades some fidelity for pace; heavy guidance on top can push faces around. If identity drifts, ease nag_scale back rather than fighting it with more.

CategoryKJNodes/wan

Inputs (7)

NameTypeDefaultDescription
modelMODEL
conditioningCONDITIONING
nag_scaleFLOAT11.0000–100Strength of negative guidance effect
nag_alphaFLOAT0.2500–1Mixing coefficient in that controls the balance between the normalized guided representation and the original positive representation.
nag_tauFLOAT2.5000–10Clipping threshold that controls how much the guided attention can deviate from the positive attention.
input_typeoptCOMBOType of the model input
inplaceoptBOOLEANfalseIf true, modifies tensors in place to save memory. Leads to different numerical results which may change the output slightly.

Outputs (1)

NameTypeDescription
modelMODEL