ComfyUI-NAG-Fixed
A patched version of ComfyUI-NAG implementing Normalized Attention Guidance (NAG) for diffusion models with compatibility fixes for the latest ComfyUI version.
ComfyUI-NAG-Fixed
ComfyUI-NAG with compatibility fixes for the latest ComfyUI version.
What is this?
This is a patched version of ChenDarYen/ComfyUI-NAG -- a ComfyUI custom node implementing Normalized Attention Guidance (NAG) for diffusion models.
Why does this exist?
The original NAG node uses imports that broke after a ComfyUI refactor. Specifically, DoubleStreamBlock and SingleStreamBlock were moved from comfy.ldm.chroma.layers to comfy.ldm.flux.layers, but the original code still imports from the old (now-None) path.
Fixes applied
- Folder renamed: ComfyUI-NAG -> ComfyUI_NAG (Python module names cannot contain hyphens)
- chroma/layers.py: from comfy.ldm.chroma.layers -> from comfy.ldm.flux.layers
- chroma/model.py: from comfy.ldm.chroma.layers -> from comfy.ldm.flux.layers
All other submodules (flux, sd, sd3, wan, hidream, hunyuan_video) use comfy.ldm.flux.layers directly and work correctly.
Installation
Backup your existing NAG folder first, then: cp -r ComfyUI-NAG-Fixed your_comfyui_path/custom_nodes/ComfyUI_NAG
Then restart ComfyUI. Search for NAG in the node browser.
Credit
Original NAG by ChenDarYen: https://github.com/ChenDarYen/ComfyUI-NAG Paper: https://arxiv.org/abs/2505.21179
License
Same as original project (see LICENSE file).