WanVideo Apply NAG
Get your negative prompt back at CFG 1 on Wan
- original_text_embeds
- nag_text_embeds
- text_embeds
Here's the problem this solves. The moment you stack a speed LoRA on Wan - CausVid, lightx2v, the usual suspects that cut generation to a handful of steps - you're forced to CFG 1.0. And at CFG 1 there's no classifier-free guidance, which means your negative prompt does nothing. It's just dead weight in the graph. WanVideoApplyNAG brings negative control back without giving up the speed LoRA, using NAG (Normalized Attention Guidance, by ChenDarYen), which reintroduces a negative signal through the model's attention instead of through a second guidance pass.
Worth a clarification since there are two similarly-named nodes floating around: this is the WanVideoWrapper's version, and it works on your text embeds - it merges NAG negative embeds into your positive prompt embeds. (The similarly-named node in Kijai's KJNodes pack does the same job by patching the model instead. Same technique, different plumbing; use whichever matches the pack your graph is built in.)
How it works
You give it your normal prompt embeds and a second set of embeds for what you want to steer away from. NAG combines them so that during sampling the attention gets nudged against the negative concept - and because it operates in attention space, it doesn't care that CFG is pinned at 1. That's the entire point. Out comes a single set of text embeds carrying both signals, which you feed to the sampler exactly as you would a normal prompt.
The inputs and outputs that matter
original_text_embeds(WANVIDEOTEXTEMBEDS) - your positive prompt, already encoded.nag_text_embeds(WANVIDEOTEXTEMBEDS) - the negative: encode the stuff you don't want (plastic skin, extra limbs, warping) and plug it in here. This is what gives the node something to push against.nag_scale(default 11) - strength, and the knob you'll actually turn. If the negative isn't biting, raise it; the default is a starting point, not a ceiling.nag_tau(2.5) andnag_alpha(0.25) - normalization internals. Leave them alone unless you really know what you're chasing.inplace(optional, default true) - whether it modifies the embeds in place.
Output is text_embeds (WANVIDEOTEXTEMBEDS) - wire it into the sampler in place of your original positive embeds.
How to install it
Ships in the WanVideoWrapper. ComfyUI Manager: search ComfyUI-WanVideoWrapper, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt
then restart. No extra model download - NAG works with the Wan model and text encoder you already have.
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+), your ordinary negative prompt already works and NAG buys you nothing. This node earns its place specifically on the fast, CFG-1 path - that's where a normal negative is dead.
The effect is weak. Push nag_scale up, and make sure nag_text_embeds is a genuine negative, not an empty or zeroed encode. A blank negative gives NAG nothing to work with.
It clashes with your cache. NAG has a long-standing habit of not playing nicely with TeaCache-style caching. If NAG does nothing or errors in a graph that has a cache node, pull the cache out and retest - then decide which one you'd rather keep.
Faces get pushed around. Speed-LoRA Wan already trades some fidelity for pace, and heavy guidance on top can shove faces. If identity starts drifting, ease nag_scale back rather than cranking it further.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| original_text_embeds | WANVIDEOTEXTEMBEDS | — | |
| nag_text_embeds | WANVIDEOTEXTEMBEDS | — | |
| nag_scale | FLOAT | 11.00–100 | — |
| nag_tau | FLOAT | 2.50–10 | — |
| nag_alpha | FLOAT | 0.250–1 | — |
| inplaceopt | BOOLEAN | true | If true, modifies tensors in place to save memory. Leads to different numerical results which may change the output slightly. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text_embeds | WANVIDEOTEXTEMBEDS | — |